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 trialRachel Lev
14,583 PointsMarkdown Cheatsheet - not working for me. when I try to post code.
how to post javascript code?
3 Answers
Dave Harker
Courses Plus Student 15,510 PointsHi Rachel,
Just type in three backticks (the tilde key without shift) ``` and then put the programming language name (not required but apparently helps with formatting/syntax highlighting). Then hit enter/return to go to a new line and paste in/type in your code. After the code hit enter/return to go to a new line again and enter three more backticks ``` to close it off.
So it might look something like this:
```JavaScript
<code goes here>
```
Best of luck,
Dave
Rachel Lev
14,583 PointsThanks for your help Dave. However, it's still not working..
behar
10,799 PointsHey Rachel! Try to actually post a comment where you do exacly what Dave told you to?
Rachel Lev
14,583 Pointsvar answer = prompt("What is the best programming language?");
if (answer == 'JavaScript') {
return alert("You are correct");
};
Rachel Lev
14,583 PointsIt worked! Thank you Dave and Behar!
Dave Harker
Courses Plus Student 15,510 PointsDave Harker
Courses Plus Student 15,510 PointsEnds up looking like: