subject
Computers and Technology, 25.04.2020 03:15 ayjahj

The validCredentials() function contains two parallel arrays of usernames and passwords. Modify validCredentials() to use the .indexOf () method to search the usernames array for the given enteredUsername. If the username is found, the same location in the passwords array should contain the enteredPassword. Return true if the passwords are equal, false otherwise. validCredentials() should also return false if the given username was not found 2 I false otherwise 3 function , enteredPassword) 4 5// Database of usernames and passwords 6 var usernames = ["smith", "tron", 7 var passwords = ["qwerty", "End0fL ine", "year1942", "1adyj123", ace" "ladyj", "anon"]; "PASSWORD"); 9 I Search the usernames array for enteredUsername 10 11 // Only return true if the enteredUsername is in username, and the 12 // same location in passwords is enteredPassword 13 return true 15 17 console. log(" Login for ladyj:"validCredentialsC"Ladyj", "ladyj123)); // true 18 console. log("Login for ace: " validCredentialsC"ace", "wrong"); // false 19 console. log("Login for jake: " validCredentialsC"jake", "???"); // false Run JavaScript Reset code Your console output Login for ladyj: true Login for ace: true Login for jake:

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
Discuss the ways in which electronic information associated with payments is addressed in terms of security. include encryption, secure sockets layers, and secure electronic transactions in your discussion. are there any other ways that consumers and businesses can keep their payment information secure in an electronic commerce environment? do you feel that your information is safe when conducting electronic business? why or why not?
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
Which of the following factors would your hypothetical supervisor look at when deciding whether to test a biological material sample for dna? the amount of other evidence you have implicating a suspect in a crime the annual budget for the crime lab both of the above none of the above; you would almost always order a test
Answers: 3
question
Computers and Technology, 22.06.2019 23:30
For her science class, elaine is creating a presentation on weather in the united states. she wants to make the presentation beautiful and interesting by drawing simple cloud or wave shapes. which is the best way for elaine to draw these shapes?
Answers: 1
question
Computers and Technology, 24.06.2019 01:00
Answer these and get 40 points and brainliest
Answers: 1
You know the right answer?
The validCredentials() function contains two parallel arrays of usernames and passwords. Modify vali...
Questions
question
Mathematics, 22.09.2019 03:50
question
Geography, 22.09.2019 03:50
question
Arts, 22.09.2019 03:50
question
Mathematics, 22.09.2019 03:50
question
Mathematics, 22.09.2019 03:50
question
Business, 22.09.2019 03:50
Questions on the website: 13722360