Skip to content

Instantly share code, notes, and snippets.

@itproto
Created June 26, 2024 09:17
Show Gist options
  • Select an option

  • Save itproto/68975181ba0d7cba2b7dc8897c7d5bfd to your computer and use it in GitHub Desktop.

Select an option

Save itproto/68975181ba0d7cba2b7dc8897c7d5bfd to your computer and use it in GitHub Desktop.

Revisions

  1. itproto created this gist Jun 26, 2024.
    27 changes: 27 additions & 0 deletions Readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    any
    void

    boolean
    number
    string

    null
    undefined

    bigint
    symbol

    string[] /* or Array<string> */
    [string, number] /* tuple */

    string | null | undefined /* union */

    never /* unreachable */
    unknown
    enum Color {
    Red,
    Green,
    Blue = 4
    };

    let c: Color = Color.Green
    9 changes: 9 additions & 0 deletions classes.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    class Point {
    x: number
    y: number
    static instances = 0
    constructor(x: number, y: number) {
    this.x = x
    this.y = y
    }
    }