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
Andrea Faciane
10,042 PointsTime Calculator
My time calculator does not calculate. I made attempts to take a snapshot of my code so that other members can view. I hope that you can locate this. I'm rather discouraged.
Andrea Faciane
10,042 PointsThank you
var secondPerMin = 60;
var minsPerhour = 60;
var hoursPerDay = 24;
var daysPerWeek = 7;
var weeksPerYear = 52;
var secondsPerDay = secondsPerMin * minsPerHour * hoursPerDay;
document.write('There are ' + secondsPerDay + ' seconds in a day');
please correct me if I made mistakes thanks
Alexander Davison
65,469 PointsPlease use three backticks and not just one
However, you code is still sort of readable, it's just for future note if you get lots of code.
Alexander Davison
65,469 PointsAfter you run your program (don't switch tabs or windows!), try pressing Ctrl (or Cmmd if you are on a mac) and Shift and the letter i at the same time on your keyboard.
What errors you do see? It should be highlighted in red.
1 Answer
Jason Anders
Treehouse Moderator 145,863 PointsHey Andrea,
First I corrected your markdown for the code snippet. You had it right, it just needs to have 2 hard returns after any text before the opening backticks, a hard return after the opening 3 backticks and a hard return after your last line of code before the closing 3. (And it's good to add the language it's in for syntax highlighting). If you click the ... under your comment, you can select "edit comment" and you'll be able to see what I mean. :)
As for your code, everything is okay, you just have 2 typos in the variable name when you are defining them.
- You have
secondPerMininstead ofsecondsPerMin(missing an 's') as it is in the call later on. - You have
minsPerhour' instead ofminsPerHour` (lower case 'h') but use an upper case 'H' later on.
Fix that up and everything works fine. :thumbs-up:
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsI don't think we're able to help you since you didn't show us any of your code...
Please provide code. Remember to wrap ``` (three backticks) around your code. Note that ` isn't the same as ' (single quote)! You can find the backtick character at the top-left of your keyboard.
Example:
```
if (name == 'Andrea') {
alert("Hello there");
}
```
Example without formatting (bad, hard to read):
if (name == 'Andrea') { alert("Hello there"); }