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

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
229,004 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
229,004 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!