max value of int in javascript code example
Example 1: javascript int max
console.log(Number.MAX_SAFE_INTEGER);
// expected output: 9007199254740991
Example 2: find max value in javascript
x = findMax(1, 123, 500, 115, 44, 88);
function findMax() {
var i;
var max = -Infinity;
for (i = 0; i < arguments.length; i++) {
if (arguments[i] > max) {
max = arguments[i];
}
}
return max;
}