Ad

It goes to minus infinity, math logarithmic expressions look if you want

Code
Diff
  • function findMax(arr) {
      arr.sort((a, b) => b - a);
      return arr[0]
    }
    • findMax = a => a.reduce((x, y) => x > y ? x : y, -Infinity)
    • function findMax(arr) {
    • arr.sort((a, b) => b - a);
    • return arr[0]
    • }