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 trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Jessica Perry](https://uploads.teamtreehouse.com/production/profile-photos/11692773/micro_daiwei-lu-mFeJH_0m75w-unsplash.jpg)
Jessica Perry
2,688 PointsTeacher notes Question: What does the "+" in +guessMore (+guessLess etc..) variable mean?
When going thru the teachers notes I noticed that in the code there was a + in front of the variables guess, guessMore, and guessLess. Can you explain why we would put a + in front of the variable name?
1 Answer
![Mark Sebeck](https://uploads.teamtreehouse.com/production/profile-photos/6569772/micro_mark.jpg)
Mark Sebeck
Treehouse Moderator 37,777 PointsHi Jessica. The plus (+) sign is the Unary Plus Operator in Javascript. It attempts to convert the variable to a number. Because we are reading from a prompt the input the user enters will be a string. We want to convert in to a number before comparing it with the correct guess. You can read more about the Unary Plus Operator here. Hope this helps Jessica and good luck on your coding journey.
Jessica Perry
2,688 PointsJessica Perry
2,688 PointsThis does help! Thank you so much for your answer. I have moved on in the track to "Converting strings to Numbers". I wanted to ask if this was a shorthand way of converting a string to a number vs the
parseInt()
?