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.
OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World ...