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 Numbers Working with Numbers Numbers and Strings

Why is my answer not working?

Don't know what is wrong..tried so many different things but cant figure out what is the right way..

script.js
const width = '190px';
const totalImages = 10;


parseInt(width);
totalWidth = parseInt(width) * totalImages;
console.log = totalWidth;

2 Answers

Bare with me here hannah Javascript isn't exactly my strong suit. but I BELIEVEEE your answer should look like this

const width = '190px';
const totalImages = 10;
var totalWidth = parseInt(width) * totalImages ;

Hope this helps :P Hannah Sohn

I believe you over complicated things slightly.

Thank you! yes I definitely did over complicate things haha, I need to stop overthinking as well. Hopefully I will understand better sooner than later, Thanks again!

I think you'll do just fine hannah. I do the same thing dw :P you'll learn its not as hard as it seems. remember you have anymore questions feel free to ping me :) Hannah Sohn (plus not to worry. Javascript tends to make you overthink with all the steps it gives you but im sure youll get the hang of it)