# 箭头表达式 : 用来声明匿名函数,消除传统匿名函数的this指针问题
**箭头函数常见格式:**
![](https://img.kancloud.cn/a7/c8/a7c8c097d485089ab81f16754b63fbdd_829x176.png)
**无参数情况:**
![](https://img.kancloud.cn/1a/36/1a361ad5ca8d62e33168ea992ae0ed13_805x153.png)
**一个参数情况:**
![](https://img.kancloud.cn/b4/5b/b45b328107fe0ce22575fb170972ce3d_795x161.png)
*****
# forEach() , for in 和 for of 比较
* **forEach()循环 会忽略属性值 break无法停止程序
下图中,desc属性被忽略 无法显示**
![](https://img.kancloud.cn/01/9b/019bced79b62c4c4315ec7de3d296024_515x81.png)
![](https://img.kancloud.cn/0b/98/0b98c359c84165a13dd3de77e229fe8e_553x119.png)
* **for in 打印出键值(下标) 以及 属性值**
![](https://img.kancloud.cn/e9/d5/e9d525fb000d5e0496bb830b87b800f3_932x177.png)![](https://img.kancloud.cn/02/23/02230e1dba849258f7e3fdff7f42fe9b_837x234.png)
![](https://img.kancloud.cn/05/66/0566617a8bf3e4fa01fe80c46c6b3463_954x173.png)![](https://img.kancloud.cn/d6/ef/d6efc9e6e1c7968d8eff11a3619655ba_875x339.png)
* **for of
忽略属性值 且 循环可以被停止**
![](https://img.kancloud.cn/53/10/53104481d8bfde1fe9b116fe2c96ac96_1203x170.png)
![](https://img.kancloud.cn/9d/cf/9dcf326b13e11d5aeb979f5817329dd5_788x316.png)
![](https://img.kancloud.cn/f2/94/f294f4e96c8ad970f3f1e5f8f5cb4d00_1197x227.png)
![](https://img.kancloud.cn/cb/18/cb1887b63b1548dc1810d1fa3b45058f_758x230.png)
**可以打印字符串**
![](https://img.kancloud.cn/01/aa/01aa422848fc9d57cc1f47bcdd2311ee_546x146.png)
![](https://img.kancloud.cn/50/9d/509d716e1b0d78f0665e5d2dd4f5fc73_883x516.png)