New course! Every coder should learn Generative AI!
Try a free lesson0
I didn't understood, what difference does // or /**/ brings when we use it.
In the course, they say for making multi-line comment, we use /**/. What difference does it brings ? Pls show two examp!es also in which one will be with element and other without element
4 Answers
+ 4
Hey there, Harsh Kishore
In Javascript:
Single line comments start with //
var x = 5; // Declare x, give it the value of 5
var y = x + 2; // Declare y, give it the value of x + 2
Multi-line comments start with /* and end with */
/*
The code below will change
the heading with id = "myH"
and the paragraph with id = "myP"
in my web page:
*/
Refer to this article https://www.w3schools.com/js/js_comments.asp
+ 2
Thanx, I understood
0
Hey there, Issac Fernandes
Thanx that you responded but, can you give example of how to use it.
0
Check again (I edited my answer)