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

ricky ebanks
ricky ebanks
1,212 Points

My solution to SecondsAlive?

const MyAge = 44;
const YearstoWeeks = 52;
const DaystoWeeks = 7;
const DaystoHours = 24;
const HourstoMinutes = 60;
const MinutestoSeconds = 60;

const SecondsAlive = MyAge * YearstoWeeks * DaystoWeeks * DaystoHours * HourstoMinutes * MinutestoSeconds;

console.log (`Ive been alive for ${SecondsAlive} seconds of my life.`);

My answer: Ive been alive for 1383782400 seconds of my life.

3 Answers

Steven Parker
Steven Parker
218,635 Points

I'll bet you totally forgot to celebrate your 1-billionth birth-second. :laughing:

ricky ebanks
ricky ebanks
1,212 Points

lol sure did :) so how do you think i did on this challenge? Thanks again.

Steven Parker
Steven Parker
218,635 Points

Your solution is fine functionally.   :+1:
But for consistency, the name of the variable "DaystoWeeks" should probably be "WeekstoDays" instead.

ricky ebanks
ricky ebanks
1,212 Points

I totally missed that thank you Steven Parker

good job!