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 trialnxtstackhello
3,774 PointsWhat will appear in the JavaScript console after this code runs? console.log( parseInt( '.5 FTE' ));
what is answer
2 Answers
Steven Parker
231,269 PointsYou could always try it out and see.
But if you just think about it, the function is parseInt. "Int" stands for integer, so it's expecting to convert a whole number. But what's the first thing in the string? It's a period (or "decimal point"). A period is not part of a whole number, so the function will not consider it valid, and will return "not a number" (or NaN).
Kevin Brender a Brandis
1,382 Pointsso i answered syntex error , but it says there is nothing wrong with this code. but should it not be parseFloat for it to work?