I am stuck on this problem from NYCDA.
Write a while loop to prompt the user to guess a word (stored in a variable named word. Then exit the while loop only if the word entered is NYCDA.
You should use prompt within the while loop to change the value of user, this helps avoid an infinite loop.
So far I got this, but it says there should be a while loop in my code I am lost in this part.
var word = prompt(‘Enter a word!’);
Is this an FCC challenge? If so, can you provide the url to the challenge?
Anyway, the instructions you post says you are supposed to use a while loop. You are not using any type of loop. All you have done is assigned the value return from the prompt to the variable named word.
The following is a lesson on using while loops you can try.
No this is not, this is for a bootcamp prep activity.
I’m having REALLTY hard time with this challenge.
This is my code but what’s seems to be wrong.
Did you delete the the rest of the code?
You deleted the first comment, Don’t delete anything.
Click on reset your code and paste your code below the second comment.