const arr =['北京','上海','广州','深圳'] for (const [index,item] of arr.entries()) { console.log(index,item) } 打印结果