Can anyone see why the not statement doesn't work?
function guessTheColors(response, arr) { response = document.getElementById('color').value; arr = "red", "orange", "yellow", "green", "blue", "indigo", "violet", "RED", "ORANGE", "YELLOW", "GREEN", "BLUE", "INDIGO", "VIOLET", "Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"; for(var i = 0; i <= arr.length; i++) { if (response === "") { var ans1 = document.getElementById('errMsg').innerHTML = ("Please enter a color!"); } else if (!isNaN(response)) { var ans2 = document.getElementById('errMsg').innerHTML = ("Sorry, no numeric values!"); } else if (response != arr[i]) { var ans3 = document.getElementById('errMsg').innerHTML = ("Sorry, that\'s not a color of the rainbow!"); } else if (response == arr[i]) { var ans4 = document.getElementById('errMsg').innerHTML = ("Correct! " + response + " is one of the colors of the rainbow."); } } }