array = [1, 2, 3, 4, 5]
a = 9
for( i = 0; i < array.length; i++ ) {
if (array[i] = a) {
console.log("if +");
}
}
array = [1, 2, 3, 4, 5]
a = 9
if (array.indexOf(a) == -1) {
// not found
}
array = [1, 2, 3, 4, 5]
a = 9
found = false;
for( i = 0; i < array.length; i++ ) {
if (array[i] = a) {
found = true;
console.log("if +");
}
}
if (!found) {
// not found
}