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 trialAdam Maley
5,946 Pointscorrect + 1 wouldn't work?
I am confused on why I couldn't just use +1 vs +=1
or couldn't I increment it
correct ++ 1
2 Answers
Michael Lambert
6,286 PointsWhen incrementing by 1 you could just write it as correct ++ which just adds 1 to the current value of correct
Travis Howk
7,169 PointsIn Javascript, you have to modify the instance of the variable to get the right value. This is done using += as opposed to +1 , which is only temporary.