Help with Javascript activity

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.

Sounds like you could benefit from Free Code Camp if you are struggling with this challenge. Take a look at the Basic JavaScript section. Some of it may be a review, but you can skip around in the curriculum to understand how to use certain JavaScript functionality such as while and for loops.

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?

Did you go through the entire Basic JavaScript section of the FCC curriculum yet? Like I said before, you probaly need to learn more about the basics first, if you are having trouble with this basic challenge.

You deleted the first comment, Don’t delete anything.

Click on reset your code and paste your code below the second comment.