javascript max of two values code example
Example 1: javascript max number
MAX_SAFE_INTEGER = 9007199254740991
Example 2: max method in js
finding maximum number
console.log(Math.max(1, 3, 2));
console.log(Math.max(-1, -3, -2));
const array1 = [1, 3, 2];
console.log(Math.max(...array1));
Example 3: how to find max number in array javascript
const array1 = [1, 3, 2];
console.log(Math.max(...array1));
Example 4: find max and min value in array javascript
var numbers = [1, 2, 3, 4];
Math.max(...numbers)
Math.min(...numbers)
Example 5: js return the highest and lowest number
console.log(Math.max(1, 3, 2));
console.log(Math.max(-1, -3, -2));
const array1 = [1, 3, 2];
console.log(Math.max(...array1));