how to get the maximum value of javascript code example
Example 1: js maximum number value
Number.MAX_VALUE;
Example 2: Find the maximum number of an array js
var arr = [1, 2, 3];
var max = arr.reduce(function(a, b) {
return Math.max(a, b);
});
Example 3: How to get maximum value in Javascript
let x = Math.max(1,3,45,59,698);
console.log(x); //output 698