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 trialChandler Tayek
5,513 PointsA simple basic solution to the "How old I'm I in seconds challenge."
I noticed a lot of students where unsure if they where getting the correct answer for the challenge so I decided to add a few lines (That Dave taught us, nothing fancy) in order to check to see if you got the correct answer.
Click on this link to check your age in years: http://codepen.io/ChandlerTayek/pen/xGXKKa
For those of you feeling ambitious I challange you to click the fork button at the top bar in codepen and account for leap year + date of birth.
Please feel free to link students to this post if they want to check their code or get the answer to how old they are in seconds using my application.
(Disclaimer I did not include any leap years or leap seconds nor did I incorporate the actual month or date of birth.In other words this is a rough total. This is also based off of 364 day year which is what Dave McFarland used in the video.)
3 Answers
john larson
16,594 Pointschandler, thanks for doing that, it's nice to have a double check on my work.
jennifer ray
7,875 PointsThank you same as above excellent to be able to check I got correct answer great work :)
ioanarippel
626 Pointsthanks
Kennedy Chimwanda
10,237 PointsKennedy Chimwanda
10,237 PointsThat's the most logical way to come up with a solution for the task at hand, I am wondering why it outputs the
Time calculator
There are 86400 seconds in a day
in the browser not executing the prompt in line 6 [var yearsAlive = prompt("How old are you:");]