I have ToothSequence array which contains all integer type values
Whenever i want to compare the element or add integer i have to parseInt is as shown parseInt(ToothSequence[i]) + 1
var ToothSequence = $("#hndBridge").val().split("|");
for (i = 1; i <= ToothSequence.length; i++) {
if (parseInt(ToothSequence[i]) + 1 == parseInt(ToothSequence[i + 1]))
{
Is it possible to make integer array in jquery? if not please suggest me
You could do like this:
var ToothSequence = $("#hndBridge").val().split("|").map(function(e) { return +e; });
+e will convert e to a number.
--for old browser which Array doesn't have map method, use $.map instead--
var ToothSequence = $.map($("#hndBridge").val().split("|"), function(e) { return +e; });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With