Math.max think that 0.77=0.7 code example
Example 1: math.max in javascript
Math.max() function returns the largest of the zero or more numbers given as input parameters.
Math.max(1,10,100);
Example 2: Number.prototype.between = function(a, b) { var min = Math.min.apply(Math, [a, b]), max = Math.max.apply(Math, [a, b]); return this > min && this < max; };
function getArrayMax(array){
return Math.max.apply(null, array);
}
function getArrayMin(array){
return Math.min.apply(null, array);
}
var ages=[11, 54, 32, 92];
var maxAge=getArrayMax(ages);
var minAge=getArrayMin(ages);