Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Numbers Working with Numbers Create a Program with Math

Tural Rzazade
Tural Rzazade
3,397 Points

MyCode

const secsPerMin = 60;
const minsPerHour = 60;
const hoursPerDay = 24;

//const daysPerWeek = 7;
//const weeksPerYear = 52;
//
//secondsPerDay = secsPerMin * minsPerHour * hoursPerDay;
//
//console.log(`There are ${secondsPerDay} seconds in a day.`)

const yearsAlive = 24;
const daysPerYear = 365;
const secsAlive = secsPerMin * minsPerHour * hoursPerDay * daysPerYear;


console.log(`I've been alive for more than ${secsAlive} seconds!`);
jessicakincaid
jessicakincaid
21,241 Points

Do you have a question? Are you receiving an error?

3 Answers

Steven Parker
Steven Parker
218,692 Points

I'm guessing there's no question or error here, but this is just a response to the instructor's suggestion in the video of "when you're done, why don't you share your solution with other Treehouse students?"   :see_no_evil:

josephweiss2
josephweiss2
5,828 Points

Nicely done!!! Go further with your excellent coding!!

Tural Rzazade
Tural Rzazade
3,397 Points

Thank you guys! :) Everything is fine! I know it seems a little strange to post your code by using "Get help" button, but as you guessed I did it according to Guil's suggestion. 👻