let f = [-3, 0, 45, 22, 123, -485, 98, 34];
function largestIndex(array) {
let counter = 1;
let max = 0;
for (counter; counter < array.length; counter++) {
if (array[max] < array[counter]) {
max = counter;
}
}
return max;
}
console.log("index with largest value is: " + largestIndex(f));