CodeOrc.com - Learn by example
X
Make an RPG
Vue Implementations

Javascript comments

Javascript has 2 types of comments. This is a one line comment

// One line comment.

Examine the difference. Which of the print statements will show up?

function print( a ) { $('.print').append( a + '<br>' ); } print('Hello'); // print('Hello 2');

This is a multi-line comment

/* here is a multi-line coment print('this will not show up'); */ print('this does show up.')

You can put anything you want between the comment begin /* and the comment end */

Comments are used to explain why your code works the way it does

In the next lesson, we will learn about Javascript Arrays

Get the Latest Tutorial Updates
<< >>
X