Comments

It is standard programming practice to leave human-readable comments.

This helps other programmers understand what you've written. A comment either starts with // and continues to the end of the line, or encloses all the text between the special character sequence /* and */.

Loading TypeScript...

Notice there is one ray of the sun in the image above which is not print out, and it appears in a different color when we see it as code. This is because the backward slash (\) is an escape character, which allows us to represent certain special characters like the new line character (\n).

Loading TypeScript...

Was this page helpful?