[Solved] javascript “if” statement returning false value when both values are equal
You are breaking the loop and your if(valid) code is within the for loop. You probably meant to have the if(valid) outside the for loop scope. For example you can do: valid = false; for (var i = 0; i < usernameArray.length; i++) { if ((un == usernameArray[i]) && (pw == passwordArray[i])) { valid = … Read more