JSRUN 用代码说话
xoxzZ
cai1
第73645位JSRUN用户

活跃于 2023-12-19 11:21 访问量:556
关注


xoxzZ(cai1)

2023-11-10 13:53
# 数组使用entries()方法 ``` var fruits = ["Banana", "Orange", "Apple", "Mango"]; const arr = fruits.entries(); fruits.forEach(i=>{ console.log(arr.next().value); }) for(let [index,value] of fruits.entries()){ //利用数组解构 console.log(index,value) } console.log(Object.entries(fruits)); ```


没有了
1/1
没有了