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
Tyson Van Buren
3,692 PointsHelp
A variable named "boxWidth" already exists with a value of "640px". Create a new variable named "numWidth" and use the "
<script>
var boxWidth = "640px";
var boxHeight = "480px";
var numWidth = parseInt("640px");
</script>
What is wrong with my code?
3 Answers
James Barnett
39,199 PointsUse the variable boxWidth instead of the string literal of its value.
Bryan Jenkins
5,438 PointsNothing is "wrong" with it, the challenge is asking you to make use of the variable that you already set to 640px though instead of rewriting it.
Tyson Van Buren
3,692 PointsThanks guys
Dino Paškvan
Courses Plus Student 44,108 PointsDino Paškvan
Courses Plus Student 44,108 PointsAlso, you should always specify the
radixparameter to avoid confusion and weird behaviour, like this:var parsedString = parseint(someString, 10);Finally, Tyson, I encourage you to use more descriptive discussion titles than just "Help!" as you've been doing so far. You'll find that people are more likely to answer such topics and they're also easier to discover by users needing help on the same task.
James Barnett
39,199 PointsJames Barnett
39,199 PointsGood call about the radix, I left it out.