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 trialMatthew Sharikov
5,767 PointsUnary Plus Operator Question
Question; In the editor, initialScore represents a user's score in a game. A user managed to beat the current level so first, let's add 1 point to their initial score using the unary plus operator.
Can someone please help with this?
var initialScore = 8
initialScore = initialScore +1
3 Answers
Alexander Davison
65,469 PointsYou didn't use the Unary operator, but did do the same logic.
Try:
var initialScore = 8
initialScore += 1
Matthew Sharikov
5,767 PointsThank you so much Alexander! It worked.
Alexander Davison
65,469 PointsNo problem :)
zbanx
3,264 PointsOMG I justs spent 15 minutes on this. Thank you whoever you are Alexander.