Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript comment

You can use double slash //for single line of code

//console.log("Hello world!")

If you want to comment out multiple lines of code here is the two ways.

First: everything between /**/

/*
console.log("Hello world1!")
console.log("Hello world2!")
console.log("Hello world3!")
*/

Second: select all lines, which you want to comment out and use:
ctrl+k+c //to comment out
ctrl+k+u //to uncomment 

//console.log("Hello world1!")
//console.log("Hello world2!")
//console.log("Hello world3!")
Comment

javascript comments

// Comment

/*	
Also a
Comment 
*/
Comment

js comment

/*
The code below will change
the heading with id = "myH"
and the paragraph with id = "myP"
in my web page:
*/
document.getElementById("myH").innerHTML = "My First Page";
document.getElementById("myP").innerHTML = "My first paragraph.";

let x = 5;      // Declare x, give it the value of 5
let y = x + 2;  // Declare y, give it the value of x + 2


// Change heading:
document.getElementById("myH").innerHTML = "My First Page";

// Change paragraph:
document.getElementById("myP").innerHTML = "My first paragraph.";
Comment

comments js

//Single line

/*
Multiple line
*/
Comment

Javascript comment

//I'm a single line comment

/* I'm comment on
*  more then one line.
*/ 
Comment

comment in JavaScript

// This is how you comment a single line in JavaScript

/*
This is how you comment
multiple lines in 
JavaScript
*/
Comment

Javscript function comments @

//Single line comments with 2 forward slashes
/*
	Multi-line comments 
    with start and closing comment symbol
*/


//You can also use comments for Functions,Classes and Class Methods.
/*
  Function/Class methods comments will display the comment to developers.
  Displays comment when hovering over the function/method name.
  Might also display comment with intellisense feature.
  Should work in most IDE with intellisense for language in use.
  May need to install and set correct intellisense for language in use.
  To be placed at top of functions, classes or class methods.
*/

//EXPLANATION 
/**
 * Function/Class/Class-method Description 
 ** Double asterisk adds list items
 ** You can add url for online resources just type url
 ** there as several @ options see https://jsdoc.app/ for list and description
 ** data-type is best typed in caps
 ** intellisense may color code data-type typed in caps
 ** Format of @options below
 * @option | {data-type} | parameter-name | description
 * @return-option | {data-type} | description
*/

//IMPLEMENTATION EXAMPLE (Use example then call the function to see how it works)
/**
 * Alerts a message to user
 ** Note: doesn't display title
 ** https://jsdoc.app
 * @param {STRING} message Message to user
 * @param {STRING} username This is username
 * @param {NUMBER} age Age of User
 * @returns {BOOLEAN} Boolean
*/
function AlertSomething(message,username,age){
    alert(message + username + " . You are " + age + " years old");
    return true;
}

AlertSomething("Hello ", "Alice", 25);
Comment

comment in js

//this is a comment

/*
this
is
a
multiline
comment
*/
Comment

js comment

/* text*/
Comment

Which symbol is used for comments in Javascript?

// Which symbol is used for comments in Javascript?
// for Single line comments and

/* Multi
Line
Comment
*/
Comment

comments in js

// comment sigle line
Comment

javascript comment syntax

// single-line comment

/*
Comment with
multiple lines
*/
Comment

how to add comment in javascript

/*It is easy and important so keep going and enjoy the way to coding
still notr getting it then try follow me*/
// Single line comment is only for one line and multiline for two
// It is a good way to keep notice of your codes
/*Code*/
Comment

comment in javascript

// javascript comment
Comment

javascript comment

//short comment

//loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong comment

/*
multiple
line
comment
*/

//Comments won't be shown on the page or effect the code but will remain in website code. Useful for commenting what is the code for
Comment

javascript comment

let x = 5;      // Declare x, give it the value of 5
let y = x + 2;  // Declare y, give it the value of x + 2
Comment

commenting in javascript

//import Navbar from "./components/Navbar"
Comment

what is the javascript code for comments

/* hello ram
Hello, Bharat */
Comment

js comment

//A single line comment, also known as an end of line comment.

/*This is a longer 
  multiline comment.
*/

var str /*Multiline comments can be added almost anywhere!*/ = "foo";
Comment

js comments

<h1>lolllll</h1>
Comment

PREVIOUS NEXT
Code Example
Javascript :: nodejs mysql connection 
Javascript :: get row data in datatable 
Javascript :: javascript sort array 
Javascript :: event.target.name in setstate 
Javascript :: nestjs prisma on query 
Javascript :: listen for double click before click 
Javascript :: Get google maps getplace lat and long 
Javascript :: unexpected token w in json at position 0 
Javascript :: how to make array empty 
Javascript :: useformik checkbox multiselect 
Javascript :: use localstorage react hook 
Javascript :: read files in javascript 
Javascript :: uiimage from assets 
Javascript :: algolia docs react instant search 
Javascript :: angular singleton service example 
Javascript :: on enter to tab javascript 
Javascript :: email valid javascript 
Javascript :: pug iterate array 
Javascript :: create div with js 
Javascript :: Uncaught (in promise): NotReadableError: Could not start video source 
Javascript :: mongoos populate a ref 
Javascript :: how to change the text of a paragraph 
Javascript :: JavaScript querySelector - By Tag name 
Javascript :: .keys() array 
Javascript :: npm ERR! code EPERM 
Javascript :: eslint disable line 
Javascript :: cheapest node js hosting 
Javascript :: js class syntax 
Javascript :: initialize set with array javascript 
Javascript :: js localstorage clear 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =