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!
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 trial
theo vg489 Points
Questions -= 1 doesn't work
questions = questions - 1;
But when writing
questions -= 1;
i have an error.
Bellow is my full code :
What's the problem here ? I really don't understand.
Steven Parker228,095 Points
You should only declare a variable once, all other references should not have "var" in front of them:
var questions = 3; // "var" is correct the first time // ... questions = questions - 1; // but after that, don't use "var" again // ... questions -= 1; // same here