Horje
How to Create a Single Line Comment in JavaScript ?

In JavaScript, you can create a single-line comment using the // double forward slash. Everything following // that line will be treated as a comment and will not be executed.

Example: the lines starting with // are single-line comments. They are ignored by the JavaScript interpreter and are purely for the benefit of developers to add explanations or notes in the code.

// This is a single-line comment

let x = 5; // You can also add a comment at the end of a line of code



Reffered: https://www.geeksforgeeks.org


JavaScript

Related
How to Create a Multi Line Comment in JavaScript ? How to Create a Multi Line Comment in JavaScript ?
How to Exit a Loop Before it Completes all Iterations in JavaScript ? How to Exit a Loop Before it Completes all Iterations in JavaScript ?
How to use the ! Operator to negate a Boolean Value in JavaScript ? How to use the ! Operator to negate a Boolean Value in JavaScript ?
What is the use of the Prompt Function in JavaScript ? What is the use of the Prompt Function in JavaScript ?
What is the use of the Alert Function in JavaScript ? What is the use of the Alert Function in JavaScript ?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
12