I want to check if an Array contains a value. I tried this, but it doesn't work:
var accountList = [3, 4];
function isInArray(value, array) {
return array.indexOf(value);
}
if (isInArray(4, accountList) > -1) {
document.getElementById("pp").innerHTML = "found";
}
I want to use this to check if an input (value) is inside an Array. I use the 3, 4
value just for trying this method.
I already tried searching in other topic but I don't resolve my problem.