Question: Help With JavaScript Homework! I can't figure this out, I've been trying for hours. Instructions: 1Add an else statement within the for loop to test

Help With JavaScript Homework! I can't figure this out, I've been trying for hours.

Instructions:

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

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

2a.that iterates from 0 to secret.length

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

3.If a match is found

3a.set found to true

3b.add the character to the innerHTML of the li with the fontcolor set to red

4.Test that the guess now outputs each time with:

4a.green letters for an exact match

4b.red letters for a correct letter in the wrong location

4c.black letters for a letter not in the secret code

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!