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

Saif Khan
Saif Khan
4,866 Points

For anyone wanting to take it a little further, I wrote a program to find seconds alive for anyone working the program.

I took it one step further by writing the program to work for anyone wanting to know the secondsAlive for their age.

I created an additional variable called daysPerYear. Also created a variable called yearsAlive with a prompt stored in it asking the user, "How many years have you been alive?" Then I created the final variable secondsAlive with the formula in it.

Then I did document.write with the sentence, "You've been alive for " + secondsAlive + " seconds!"

Dave you are an amazing teacher!!! I'm glad I updated the Treehouse Track so I can learn the basics from you.

Dave McFarland
Dave McFarland
Treehouse Teacher

Awesome Saif Khan! Great job on going further with this program!!!

Raymond LeDuc
Raymond LeDuc
2,499 Points

Hey Saif, I had done the same as you. You know what they say, "Great minds think alike."