배열에서 최대값 내는건 Math.max(...array) 하면 되고 최대값 인덱스는 for문 돌려서 max===array[i] 이렇게 조건걸어주면 된다.
Math.max(...array)
max===array[i]