Ad
Code
Diff
  • const findMax = (a) => {
      if (a !== undefined && a !== null) {
        return a.sort((a, b) => a - b)[a.length - 1];
      } else return;
    };
    • const findMax = a => Math.max(...a);
    • const findMax = (a) => {
    • if (a !== undefined && a !== null) {
    • return a.sort((a, b) => a - b)[a.length - 1];
    • } else return;
    • };