Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed JavaScript Numbers!
You have completed JavaScript Numbers!
Preview
Build a short program that helps you calculate the number of seconds in a day, hours in a week, or minutes in a year.
Resources
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
in a day, hours in a week,
or minutes in a year.
0:00
You can code along with me by launching
the workspace with this video.
0:00
Open the math.js file
located inside the js folder.
0:04
The file is already linked to index.html.
0:08
Let's start by creating a few variables
that hold information about time.
0:14
First, declare a variable
named seconds per minute,
0:19
that stores the number of
seconds in a minute, 60.
0:23
Then declare for more variables for
other length of time.
0:27
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up