Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialtayjoh
2,329 PointsComplete the code below to create a variable named timeRemaining (don't assign a value to the variable).
Complete the code below to create a variable named timeRemaining (don't assign a value to the variable).
var ______ ; (fill in the blank to the left)
My answer: timeRemaining = ""
X Bummer!
Anyone know the answer? Thank you in advance =)
3 Answers
Olga DC
16,680 PointsYou only have to declare the variable, not assign a value to it. In your code, you are assigning it a value of an empty string. You only have to write this:
var timeRemaining;
Nick Trabue
Courses Plus Student 12,666 PointsYou are technically setting the variable to an empty string. If you open the console in developer tools and type in
var timeRemaining = "";
console.log(timeRemaining)
it's going to return a blank line.
var timeRemaining;
console.log(timeRemaining)
this is going to return undefined which is what the quiz is looking for
tayjoh
2,329 PointsThank you so much everyone for the quick and informative answers. I'll be sure to never make that mistake again. =)