Lesson 10: Reference error: They is not defined


#1


I am getting an error message stating "ReferenceError: They is not defined", and it is stating my syntax is wrong.


var whomst = prompt("Who's doin' the shootin'?")

var getToDaChoppa = function(){
  do {
      console.log("You gotta run! They is doin the shootin!")
  } while(whomst = they);
  
};
whomst = "them"
getToDaChoppa();


#2

var whomst = prompt("Who's doin' the shootin'?")

var getToDaChoppa = function(){
  do {
      console.log("You gotta run! They is doin the shootin!");
  } while(getToDaChoppa === "they");
 whomst = "them";
};

getToDaChoppa();

This code passes the lesson for me, but no matter what I type in, it tells me it's correct. Why is that and how do I make it so that it is only correct when it says "them" or perhaps "they"


#3

So the error message is telling you what you did wrong. You haven't made they a variable or a string so it isn't recognised.


#4

Please copy a link of the exercise url so we can see what question is asking. You are most likely passing the question by mistake.


#5

https://www.codecademy.com/en/courses/javascript-beginner-en-ASGIv/2/3?curriculum_id=506324b3a7dffd00020bf661#


#7

I use firefox when I use codecademy


#8

Your code is passing the exercise because it is asking you to make a function that console logs a string. The question isn't asking you to.

If you want to do that, you need to use If and else. I would do it and show you but I feel like you should try yourself first.


#9

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.