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

JavaScript JavaScript Basics (Retired) Making Decisions with Conditional Statements Build a Random Number Guessing Game

can'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

The 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.

thanks!