javascript - Is it possible to have integer array in jquery -


i have toothsequence array contains integer type values

whenever want compare element or add integer have parseint shown parseint(toothsequence[i]) + 1

 var toothsequence = $("#hndbridge").val().split("|"); (i = 1; <= toothsequence.length; i++) {   if (parseint(toothsequence[i]) + 1 == parseint(toothsequence[i + 1]))   { 

is possible make integer array in jquery? if not please suggest me

you this:

var toothsequence = $("#hndbridge").val().split("|").map(function(e) { return +e; }); 

+e convert e number.

--for old browser array doesn't have map method, use $.map instead--

var toothsequence = $.map($("#hndbridge").val().split("|"), function(e) { return +e; }); 

Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -