$ ./guess_the_languageProblem Solving — fix the bug
Problem Solving — fix the bug · easy · #24

Which fix removes the bug?

const max = Math.max([4, 9, 1]);
  1. Use Math.maximum
  2. Use Math.max.apply([4,9,1])
  3. Sort the array first
  4. Use Math.max(...[4, 9, 1])
Math.max takes individual args; spread the array.
Play Problem Solving ▸