for...in 循环:只能获得对象的键名,不能获得键值 for...of 循环:允许遍历获得键值 var arr = ['red', 'green', 'blue'] for(let item in arr) { console.log('for in item', item) } /* for in item 0 for in item 1 for in item 2 */ for(let item of arr) { console.log('for of item', item) } /…