数组使用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));