Question: Help with my JavaScript Work. Add an else statement within the for loop to test whether the current character is in the code but not

Help with my JavaScript Work.

Add an else statement within the for loop to test whether the current character is in the code but not in the right location.

Build a second for loop (this will be in your else statement. Remember that your outer loop has already been created)

that iterates from 0 to secret.length

and checks the users guess character against all the other characters in the secret code

I have been trying for hours but I really can't figure out this step.

My Code:

Mastermind

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!