Ex. 6 Reference Error: rate is not defined


#1


https://www.codecademy.com/courses/javascript-beginner-en-x9DnD/0/6?curriculum_id=506324b3a7dffd00020bf661#

Create a variable called feedback and prompt the user to rate your game out of 10.
If feedback is greater than 8, print out: "Thank you! We should race at the next concert!"
Otherwise, print out: "I'll keep practicing coding and racing."

var feedback = prompt("Rate the game, 1 out of 5.")
if(rate>5)
{
console.log("Thank you! We should race at the next concert!'")
}
else(feedback<5)
console.log("I'll keep practicing coding and racing.'");
var feedback = prompt("Rate the game 1 out of 5");
if(feedback>8)
{
console.log("Thank you! We should race at the next concert!'");
}
else{
console.log("I'll keep practicing coding and racing.'");
}


ReferenceError: rate is not defined


`


#2

I changed the 8 to a 5. I can't get it to recognize whatever I input...


#3

Thats correct rate is not defined What do you have define as a variable

var feedback = prompt("Rate the game, 1 out of 5.")
if(rate>5)
{
console.log("Thank you! We should race at the next concert!'")
}

#4

I have tried 5 and 1 and both came back with that error.


#5

var feedback = prompt("Rate the game 1 out of 5");
if(feedback>8)
{
console.log("Thank you! We should race at the next concert!'");
}
else{
console.log("I'll keep practicing coding and racing.'");
}

this code you have here is correct
and get rid of
var feedback = prompt("Rate the game, 1 out of 5.")
if(rate>5)
{
console.log("Thank you! We should race at the next concert!'")
}
else(feedback<5)
console.log("I'll keep practicing coding and racing.'");


#6

4 isn't recognized either.


#7

Also you need to have the condition for if to be above 8
If (feedback > 8){
console.log("Thank you! We should race at the next concert!");
}


#8

you're right. I got it to work. thank you fearless angel


#9

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