getting largest number in js code example
Example 1: javascript int max
console.log(Number.MAX_SAFE_INTEGER);
// expected output: 9007199254740991
Example 2: greater number in arraya jd
var array = [3 , 6, 2, 56, 32, 5, 89, 32];
var largest= 0;
for (i=0; i<=largest;i++){
if (array[i]>largest) {
var largest=array[i];
}
}
console.log(largest);