摘要: for...in本身是Object的遍历方法,js中的数组也继承自Object,所以也能够使用for...in遍历出属性。然而for...in遍历数组时有一些细节需要注意。 1、for...in遍历的属性是字符串,而不是数字 const arr = [1, 2, 3] for (const i in 阅读全文
posted @ 2022-05-22 18:30 吴小明- 阅读(325) 评论(0) 推荐(0) 编辑