Skip to main content
Version: Next

Comments

JsLIGO multi-line comments work in a way similar to JavaScript comments:

/*
This is a multi-line comment
*/

Unlike in JavaScript, JsLIGO comments can be nested as long as each comment is properly closed. Nesting comments like this allows you to comment out a large piece of code that may include other comments.

/* This is a multi-line comment.
/* This is a "nested" comment. */
*/

Both LIGO syntaxes also use single-line comments like JavaScript. Any code between two slashes (//) and the end of the current line is treated as a comment.

const x = 10; // This is a single line comment
note

Comments can contain UTF-8 glyphs. Although comments are not included in the generated Michelson code, UTF-8 glyphs may affect error messages and other compiler messages. Depending on how your editor handles these characters, the lines and columns in compiler messages may not line up with the lines and columns in your editor.