Posts

Showing posts from February, 2022

JavaScript: Comments

  JavaScript:   Comments This JavaScript tutorial explains how to use comments in the JavaScript language with syntax and examples. Description In JavaScript, you can place comments in your code that are not executed as part of the code. These comments can appear on a single line or span across multiple lines. Let's explore how to comment your JavaScript code. JavaScript supports the same commenting styles as the C and C++ languages. Syntax There are two syntaxes that you can use to create a comment in JavaScript. Syntax Using   //   symbol The syntax for creating a comment in JavaScript using // symbol is: // comment goes here A comment started with // symbol must be at the end of a line in your JavaScript code with a line break after it. This method of commenting can only span a single line within the JavaScript and must be at the end of the line. Syntax Using   /*   and   */   symbols The syntax for creating a comment in JavaScript using /* and...