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

JavaScript

Rachel Lev
Rachel Lev
14,583 Points

Markdown Cheatsheet - not working for me. when I try to post code.

how to post javascript code?

3 Answers

Dave Harker
PLUS
Dave Harker
Courses Plus Student 15,510 Points

Hi 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

Dave Harker
Dave Harker
Courses Plus Student 15,510 Points

Ends up looking like:

var answer = prompt("What is the best programming language?");
if (answer == 'JavaScript') { 
  return alert("You are correct");
};
Rachel Lev
Rachel Lev
14,583 Points

Thanks for your help Dave. However, it's still not working..

Hey Rachel! Try to actually post a comment where you do exacly what Dave told you to?

Rachel Lev
Rachel Lev
14,583 Points
var answer = prompt("What is the best programming language?");
if (answer == 'JavaScript') { 
  return alert("You are correct");
};
Rachel Lev
Rachel Lev
14,583 Points

It worked! Thank you Dave and Behar!