Book
Submodule 6.2: Simple JavaScript file
Submodule 6.2: Simple JavaScript file
Completion requirements
View
- JavaScript in HTML file
- alert interaction
- Variables
- prompt interaction
- Comments in JavaScript
- Developer tools (console)
Comments in Javascript
There are two ways to write comments in our JavaScript code.
The first way is to use // your comments
.
The above can be used to comment only one line of code. Everything that is between the two tags will be ignored by JavaScript.
The second way is to use /* your comments */
.
We use this when we want to comment multiple lines. Again, everything between the two tags is ignored by JavaScript.
For more information: https://www.w3schools.com/js/js_comments.asp