samedi 3 janvier 2015

How to use Math.max and Max.min functions in an Array?


I tried this method in an array to get min and max values but it doesn't work.



var array = [3, 6, 1, 5, 0, -2, 3];
var min = Math.min( array );
var max = Math.max( array );
document.write(max);




Aucun commentaire:

Enregistrer un commentaire