首页 > 技术文章 > for of 与 for in

lurending0417 2019-03-12 10:20 原文

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

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

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

推荐阅读