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 trialNelson Lourenco
1,766 PointsHow is my response not generating?
var secondsPerMin = 60;
var minsPerHour = 60;
var hoursPerDay = 24;
var daysPerWeek = 7;
var weeksPerYear = 52;
var daysPerYear = 365;
var yearsAlive = 31;
var secondsPerDay = secondsPerMin * minsPerHour * hoursPerDay;
document.write('There are ' + secondsPerDay + ' seconds in a day');
var secondsAlive = secondsPerDay * daysPerYear * yearsAlive;
document.write('I have been on this earth for more than ' + secondsAlive ' and counting!');
I don't understand how the first document.write example renders correctly but not the second one I wrote. Any help? Thanks!
2 Answers
Chris Bennett
7,499 PointsLooks like you forgot a + sign on the second one after secondsAlive ...
john larson
16,594 Pointshow did you get your code to post to the forum? that never works for me
Kennedy Chimwanda
10,237 PointsCopy it direct from the workspace and it should look like actual code...
john larson
16,594 Pointsty kennedy, I'll give that a try
Josue Rodriguez
438 PointsJosue Rodriguez
438 PointsWhat is wrong with my code? why wont it run? am i missing something?
var secondsPerMinute = 60; var minsPerHour = 60; var hoursPerDay = 24; var daysPerWeek = 7; var weeksPerYear = 52; var secondPerDay = secondsPerMinute * minsPerHour * hoursPerDay; document.write('There are ' + secondsPerDay + ' seconds in a day');