I'm having trouble making this function work. I want the array to display a specific value in the variable, but it's not functioning as expected. This is the function that's causing me problems:
var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
if(num == 11) {
var numCheck = document.getElementById("numCheck").value;
if (numCheck.indexOf(numbers)) {
document.getElementById("outputNum").innerHTML = "Yes, the number exists in the array";
} else {
document.getElementById("outputNum").innerHTML = "No, the number does not exist in the array";
}
}