Comment out a line of code in JavaScript?

Answered
coderguy asked this question 4 months ago
coderguy on Jan 20

How do you comment out a line of code in JavaScript? And can you do multiple lines at once too?

2 suggested answers
suparman21 on Jan 21

Comment a single line:

// commented out line

Comment multiple lines:

/* 
  commented out line
  commented out line
*/
0 replies
moon_man41 on Jan 21

Place a double forward slash (//) at the beginning of any line you want commented out:

// commented out
0 replies
Answered