I didn't understood, what difference does // or /**/ brings when we use it. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

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

29th May 2021, 4:40 AM
Harsh
Harsh - avatar
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
29th May 2021, 4:43 AM
Isaac Fernandes
Isaac Fernandes - avatar
+ 2
Thanx, I understood
29th May 2021, 4:50 AM
Harsh
Harsh - avatar
0
Hey there, Issac Fernandes Thanx that you responded but, can you give example of how to use it.
29th May 2021, 4:45 AM
Harsh
Harsh - avatar
0
Check again (I edited my answer)
29th May 2021, 4:46 AM
Isaac Fernandes
Isaac Fernandes - avatar