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 trialmalcolm mowlam
3,856 Pointschallenge task 1 of 1 javascript working with numbers
can anyone please point me in the right direction
const width = '190px';
const totalImages = 10;
let totalWidth = parseInt(num;) * 10;)
const pixels = ("190" * 10;)
2 Answers
Heidi Fryzell
Front End Web Development Treehouse Moderator 25,178 PointsHi Malcom,
The challenge is asking you to create one new variable: totalWidth by multiplying the width variable and the totalImages variable.
In pseudo code
Total Width = Width * Total Images
You are definitely on the right track!
You can apply parseInt() directly to the width the variable to extract just the integer "190". totalImages is already an integer so you can multiply by that variable without using the parseInt() function.
const width = '190px';
const totalImages = 10;
const totalWidth = parseInt(width) * totalImages;
Hope this helps. Happy coding! Heidi
malcolm mowlam
3,856 PointsThank you Heidi that's sorted good luck to you and thank you