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 Basics (Retired) Working With Numbers Doing Math

i think i nailed it guys :) !

var YearsAlive = 31 ;

var SecondsPerMin = 60 ;

var MinutesPerHour = 60 ;

var HoursPerDay = 60 ;

var DaysPerYear = 365 ;

var SecondsAlive = SecondsPerMin*MinutesPerHour*HoursPerDay*DaysPerYear*YearsAlive ;

document.write ("i have been alive "+ SecondsAlive +" seconds during 31 years" );

this is my code and the way i managed to do it to solve the challenge , any feedback or criticisms would be appreciate it or maybe another way to do it better anything would be appreciate it guys Thanks in advanced :)

2 Answers

Shouldn't

var HoursPerDay = 60 ;

be

var HoursPerDay = 24 ;

YESSSS THANKS FOR catching that , such a syntax error of mine :((( well at least i got it to show on document.write :D

Aurelian Spodarec
Aurelian Spodarec
10,801 Points

It's not a 'syntax' error. Rather logic error :)