Was wondering if anyone can tell me why the code below does not work!
I am presuming it is something to do with the array but can't figure it out.
var userpasswords = ['sooty', 'plane', 'sandra', 'football', 'laundry'];
password = window.prompt('Please enter your password','')
while (password != userpasswords)
window.prompt('You have not entered a incorrect password. Please try again','');
document.write('You are logged in')
> I can follow your code apart from the first line.
I am just stepping through the elements of the array using a loop and comparing each element with the user input. If it matches, then the user has entered a correct password. If all the elements have been tested without a match, then the password is incorrect.