for in 和 for of 的区别 区别:for in 用于迭代 对象,for of 用于迭代 数组。(记住!记牢!下面要考!) 用法: for in const obj = { a: 'aaa', b: 'bbb' }; for(let i in obj) { console.log('obj[i]---' + obj[i], 'obj.i---' + obj.i, 'i---' + i, 'typeof i---' + typeof i); // obj[i]---aaa obj.i---undefined i---a typeof i---string // obj[...