Okay I'm a total beginner in javascript but wanting to learn. I'm working on a very simple website to start myself off, but I'm totally stuck!! I have 2 arrays and need to use either a for or while loop (no idea which, as I said, very new to this) to match them up somehow
var customercodes = new Array (5); customercodes[0] ='lt-17'; customercodes[1] = 'gw-3'; customercodes[2] = 'lg-9'; customercodes[3] = 'il-77'; customercodes[4] = 'fy-32';
These are the 2 array and I want to put in a prompt window (I can get that far!!! lol ) to give instruct user to put in a password. The password should then match up the the customercode (like password 1 is customercode 1) and display that on the screen. If a wrong password is entered, it should keep asking til a right one is entered.
Does anyone have any tips which loops to use and how I should put it??
You should first use a for/while to match the customer ID once u get a matching id then u should check for the corresponding password using if statement