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 Foundations Numbers Parsing Numbers From Strings

Brian Herbert
Brian Herbert
3,834 Points

Error on challenge or am I missing something?

I'm asked to create a variable named numWidth. I set the variable with

var numWidth = boxWidth.parseInt();

but the challenge is telling me I don't have a variable named numWidth and that I should set it with "var numWidth =...".

Clearly this is an error on the challenge, right?

Screenshot: http://cl.ly/image/2L22331V1p3O

1 Answer

The instructions probably should say function not method.

parseInt is a function that you call and pass in arguments.

var numWidth = parseInt(boxWidth, 10);

Brian Herbert
Brian Herbert
3,834 Points

Yes, that's it! Thank you.

You're welcome.

James Barnett
James Barnett
39,199 Points

Not sure who is looking after this course these days, tagging Jim Hoskins, Nick Pettit & Andrew Chalkley.