Skip to main content

Comments

Comments are used to add non-executable explanations or notes within your code. This language follows the same syntax for comments as JavaScript.

Single-line Comments

Single-line comments start with // and extend to the end of the line.

// This is a single-line comment
const x = 10; // This comment follows a statement

Multi-line Comments

Multi-line comments are enclosed by /* and */. They can span multiple lines.

/*
This is a multi-line comment
It can span across multiple lines
*/
const y = 20;

Nested Comments

⚠️ You can NOT nest multi-line comments within other multi-line comments.

/*
/* This is a nested comment */ <-- expected end of comment
This is a syntax error!
*/

Notes

  • Comments are ignored during code execution.
  • Use comments to improve code readability, clarify complex logic, or leave TODOs for later.