In this tutorial, we will learn about statements and comments.
The first statement writes the text
Test string. in the webpage.
alert( 'Hello, world!' );
This statement pops up an alert message box showing
Comments are like notes to yourself or other programmers in the programming languages. It is good practice to keep comments in your code.
statement; // this is a comment
You should always leave comments like shown in your code, because after some weeks you might forget what your code actually does and then, if you’ve left a comment, then it could help yourself remember. Also, if another programmer looks at your code, he might not understand exactly what you are doing without comments.
If you break down to a new line, whatever you write underneath here isn’t commented out anymore,
If your comments are long, you want to break them down to multiple lines, then you need to leave a multi-line comment.
/* Anything in between is commented out. */