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 trialChristopher Sea
3,726 PointsAnother way to write a comment.
if (correctGuess) {
document.write/*document.write is used to write statements on the page*/('<p>You guessed the number!</p>');
}
1 Answer
Steven Parker
231,236 PointsYou've discovered the Multi-line comment format:
// While this comment is in force to the end of the current line
/* A comment like this can span multiple lines,
or as in your example, can comment out a portion of a line
with code on both sides.
*/
Christopher Sea
3,726 PointsChristopher Sea
3,726 PointsWouldn't mine still be a single line comment?
Joshua Hardy
17,317 PointsJoshua Hardy
17,317 PointsChristopher, even though your comment only uses a single line, you formatted it as a multi line comment. This means that you can put multiple lines in the comment. If you would have used the single line syntax, you would be limited to one line of comment.