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 Create a Program with Math

My code is not working

const seconPerMin = 60;
const minsPerHour = 60;
const hoursPerDay = 24;
const daysPerWeek = 7;
const weeksPerYear = 52;

const secondPerDay = seconPerMin * minsPerHour * hoursPerDay;
Console.log(`There are ${secondPerDay} seconds in a day.`);

const yearsAlive = 33;
console.log(`I've been a live for more than ${yearsAlive * weeksPerYear * daysPerWeek * seconPerMin} seconds`);

Here is the error from JavaScript Console; math in js.8

3 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Leala Aljehane

Your code is correct, except you have a small typo. JavaScript is case-sensitive so, Console.log is not the same as console.log.

When I run your code, I get the error that "Console is not defined", which is true because the compiler doesn't understand it with a upper-cased C. Just fix that up on line 8 and it's all good to go.

Nice work! :) :dizzy:

A small note: When posting code to the Community, please use Markdown or share a snapshot of your workspace. It makes it easier for others to read the code when it's formatted for the Community, which helps with troubleshooting.

I did edit your post to include markdown, so it is formatted correctly and easy to read.

Rick Gleitz
Rick Gleitz
47,876 Points

Hi Leala, In your first console.log statement, you have Console.log. If I'm not mistaken, you also need backticks around those statements. Hope this helps!

Thank you so much. Yes, the problem was with the console. Thanks all.