Computers and Technology
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:

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 09:00, paulusl19
The first screen you see when you open word2016 what is called?
Answers: 1
image
Computers and Technology, 23.06.2019 13:30, gamingisfun
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
image
Computers and Technology, 23.06.2019 15:00, ryleerose255
Idon’t understand the double8 coding problem. it is java
Answers: 1
image
Computers and Technology, 23.06.2019 19:00, jaymc1932
Whose task it is to ensure that the product flows logically from one step to another?
Answers: 3
Do you know the correct answer?
The validCredentials() function contains two parallel arrays of usernames and passwords. Modify vali...

Questions in other subjects:

Konu
Mathematics, 22.06.2019 20:00