// for Single line comments and
/* Multi
Line
Comment
*/
Best answer
// for Single line comments and
/* Multi
Line
Comment
*/
Answer: // for single-line comments and /* … */ for multi-line comments.
// This is a single-line comment
let x = 10; // comment after code
/* This is a
multi-line comment */
let y = 20;
Everything after // on that line is ignored by the browser. Everything between /* and */ is ignored, even across several lines. Multi-line comments cannot be nested. Comments are used to explain code or to temporarily disable a line while testing.
Log in or create a free account to answer this question.