1let numbers = [4, 13, 27, 0, -5]; // Get max value of an array in Javascript
2
3Math.max.apply(null, numbers); // returns 27
4
1console.log(Math.max(1, 3, 2));
2// expected output: 3
3
4console.log(Math.max(-1, -3, -2));
5// expected output: -1
6
7const array1 = [1, 3, 2];
8
9console.log(Math.max(...array1));
10// expected output: 3