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 trialAnubhav Borgohain
2,263 Pointscan't I use Number instead of parseInt ? var guess = Number(prompt("enter a number"));
can't I use Number instead of parseInt ? var guess = Number(prompt("enter a number"));
2 Answers
Eric Butler
33,512 PointsThe short answer is yes you can use Number()
, but Treehouse almost definitely doesn't include that as a "right" answer to its question/challenge, and there is a difference between Number()
and parseInt()
, which the good folks on StackOverflow have explained here.
Anubhav Borgohain
2,263 Pointsthanks!