循环对象
var book = {
'name':'我的书',
'price': 49,
'author': ['a','b','c','d','e','f']
}
Object.keys(book).forEach(function(value,key,self){
})
for(let key in book) {
}
循环数组
var arr = [1,2,3,4,4,2,1,3,4,1];
for(int i = 0; i < arr.length; i ++) {
//最稳
}
for (let a of arr) {
//可停,支持continue,break,return
}
arr.forEach(function(value,index.self) {
//停不下来,不支持break,continue,return
})