for in 和 for of 的区别
摘要:for in遍历的是数组的索引(index)而for of遍历的是数组元素值(value0) // for in var obj = {a:1, b:2, c:3} for (let key in obj) { console.log(key) } // a b c //for of const a
阅读全文
posted @ 2022-10-29 15:31
posted @ 2022-10-29 15:31
Powered by:
博客园
Copyright © 2025 爱吃敏敏
Powered by .NET 9.0 on Kubernetes