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 trialHarris Keka
Courses Plus Student 3,611 PointsMy years alive
const secondsPerMin = 60; const minsPerHour = 60; const hoursPerDay = 24; const daysPerWeek = 7; const weeksPerMonth = 52; const yearsAlive = 30;
secondsAlive = secondsPerMin * minsPerHour * hoursPerDay * daysPerWeek * weeksPerMonth * yearsAlive;
console.log(I've lived ${secondsAlive} Seconds since I was born
);
3 Answers
Grzegorz Zielinski
5,838 PointsIn console.log command at the end of your script you've forgotten to add Template literals, that's why console.log command takes everything you typed in between brackets as a variable. Correct way of writing console.log command which includes template literals should look like that:
console.log(`I've lived ${secondsAlive} Seconds since I was born`);
Hope it helps!
Nicole Antonino
12,834 PointsYou forgot the template literals (``) in your console.log
console.log(`I've lived ${secondsAlive} Seconds since I was born`);
Harris Keka
Courses Plus Student 3,611 PointsThank you. Got that, it worked.