console.log(Number.MAX_SAFE_INTEGER); // expected output: 9007199254740991
arr.indexOf(Math.max(...arr))