for of 与 for in

参考: https://www.cnblogs.com/m2maomao/p/7743143.html

for of : es6引入的,可以遍历array、map、set、string、arguments(伪数组),不可以遍历普通对象,可以使用breakcontinuereturn 和 throw退出迭代

for in: 遍历普通对象的可枚举属性

posted @ 2019-03-12 10:20  路人丁0417  阅读(151)  评论(0)    收藏  举报