for(let [index,elem] of new Map( arr.map( ( item, i ) => [ i, item ] ) )){ console.log(index); console.log(elem);}