for(let [index,elem] of new Map( arr.map( ( item, i ) => [ i, item ] ) )){ console.log(index); console.log(elem);}
时间: 2024-10-10 00:15:46
for(let [index,elem] of new Map( arr.map( ( item, i ) => [ i, item ] ) )){ console.log(index); console.log(elem);}