Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

find the max number in an array js

var myPersons__ = document.querySelectorAll('.avtrlnk');
var maxId__ = [];
    
	for(var x = 0; x < myPersons__.length; ++x) {
		maxId__[x] = myPersons__[x].value;
	}
	myPersons__ = parseInt(maxId__.sort()[x-1]) + 1;
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #find #max #number #array #js
ADD COMMENT
Topic
Name
7+8 =