I have an array which the values are :
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26
then i want to check this values to the array :
14,15,16,17
i tried with this but didn't work :
function contains(a, toFind) {
for (var i = 0; i < a.length; i++) {
if (equalArray(a[i], toFind)) {
return true;
}
}
return false;
}
function equalArray(a, b) {
if (a.length === b.length) {
for (var i = 0; i < a.length; i++) {
if (a[i] !== b[i]) {
return false;
}
}
return true;
} else {
return false;
}
}
Anyone can help me out ?