Нет уверенности, что точно понял правила, но может так сойдет
const arr1 = [1.58, 0.12, 0.1, 0.06, 0.06, 0.06, 0.05, 0.05, 0.05, 0.05, 0.05,0.01];
const arr2 = [1.58, 0.1, 0.06, 0.06, 0.05, 0.05, 0.05, 0.05,0.01];
const findMatch = function(arr2_Iter, arr1_Iter) {
let ary = [];
let arr2_Copy = arr2_Iter.slice(0)
for(let i = 0;i < arr1_Iter.length; i++){
for(let j = 0; j < arr2_Copy.length; j++){
if(arr1_Iter[i] == arr2_Copy[j]){
arr2_Copy[j] = NaN;
ary.push(i);
break;
}
}
1 }
return ary;
}
const indexiReal = findMatch(arr2, arr1)
console.log(indexiReal);