> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript Multi-line Comment

A multi-line comment in TypeScript is a lexical construct that instructs the compiler to ignore a sequence of characters spanning one or more lines. During lexical analysis, the TypeScript scanner tokenizes these blocks as `SyntaxKind.MultiLineCommentTrivia`. While comments are classified as trivia rather than standard Abstract Syntax Tree (AST) nodes, the compiler tracks their positional ranges and associates them with adjacent AST nodes.

**Syntax**
The construct is delimited by a starting `/*` sequence and a terminating `*/` sequence.

```typescript theme={"dark"}
/*
  Line one of the comment block.
  Line two of the comment block.
*/
let x: number = 10;
```

**Technical Characteristics**

* **Inline Masking:** Although termed "multi-line," the `/* */` delimiters can be utilized inline to omit specific tokens within a single statement without breaking the line.

```typescript theme={"dark"}
const price: number = 100;
const surcharge: number = 5;
const total: number = price + /* tax */ surcharge;
```

* **No Nesting Support:** TypeScript does not support nested multi-line comments. The scanner terminates the comment block at the first instance of `*/`. Any subsequent text or closing delimiters will be parsed as standard code, resulting in a syntax error.

```text theme={"dark"}
/*
  Outer comment starts
  /* 
    Inner comment starts (Scanner ignores this as a new delimiter)
  */ // <- This terminates the entire comment block
  This text will cause a compiler error. 
*/
```

* **Compilation Behavior and Node Elision:** Because comments are treated as trivia attached to specific AST nodes, their presence in the emitted JavaScript depends on the node they are attached to. If a multi-line comment is attached to a TypeScript-only node that is elided during compilation (such as a `type` alias or `interface`), the comment is also stripped from the emitted JavaScript, regardless of the `removeComments` compiler setting. For comments attached to standard JavaScript nodes, they are preserved by default unless the `removeComments` option in `tsconfig.json` is explicitly set to `true`.
* **Pinned Comments:** A multi-line comment starting with an exclamation mark `/*!` is classified as a pinned comment. This compiler feature ensures that comments containing critical metadata are intentionally preserved in the emitted JavaScript, even when the `removeComments` option is set to `true`. Note that pinned comments will still be stripped if attached to an elided TypeScript-only node.

```typescript theme={"dark"}
/*!
 * Copyright (c) 2024. All rights reserved.
 * This comment is preserved even if removeComments is true.
 */
const appVersion: string = "1.0.0";
```

* **JSDoc Parsing:** If a multi-line comment begins with a double asterisk `/**`, it is tokenized as standard multi-line trivia but is specifically recognized as a JSDoc comment. The TypeScript language service actively parses these specific blocks to extract type information and generate editor tooling (IntelliSense).

```typescript theme={"dark"}
/**
 * This is parsed by the TypeScript Language Service.
 */
const initialize = (): void => {};
```

<div
  style={{ 
display: "flex", 
justifyContent: "space-between", 
alignItems: "center", 
maxWidth: "754px", 
padding: "1rem 0",
marginBottom: "24px"
}}
>
  <span style={{ fontWeight: "bold", fontSize: "1.25rem", color: "var(--tw-prose-headings)", fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif" }}>Tired of Poor TypeScript Skills? Fix That With Deep Grasping!</span>

  <a
    href="https://syntblaze.com"
    target="_blank"
    style={{ 
  marginLeft: "24px",
  textDecoration: "none", 
  backgroundColor: "#007AFF",
  color: "#ffffff", 
  padding: "6px 16px", 
  borderRadius: "16px",
  fontSize: "0.9rem",
  fontWeight: "600",
  textAlign: "center",
  transition: "background-color 0.2s ease"
}}
  >
    Learn More
  </a>
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/skill-tracking.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=b9b0305c93bb501c9e767b5c76c88835" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/skill-tracking.png" />

  <img src="https://mintcdn.com/syntblazellc/23tyuOzaWS88qFlc/images/nuggets.png?fit=max&auto=format&n=23tyuOzaWS88qFlc&q=85&s=c86c80197299762989e9b882419b2109" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/nuggets.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/bite-sized-exercises.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=a65f9a38c37ff28ab73ed783c53c60e3" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/bite-sized-exercises.png" />
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap", marginTop: "12px" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/mastery-chain.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=748a1763454713e679260fbb95f154a2" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/mastery-chain.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-previews.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=242f61448ff5dd6deaaab2dccc13b507" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-previews.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-explanations.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=cf0fc1c31f9cd0fc26716781be05fbc9" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-explanations.png" />
</div>
