Skip to content

Instantly share code, notes, and snippets.

@przemyslawjanpietrzak
Created September 24, 2018 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save przemyslawjanpietrzak/31e46f350e73d07de99ccd8e6ff66fd4 to your computer and use it in GitHub Desktop.
Save przemyslawjanpietrzak/31e46f350e73d07de99ccd8e6ff66fd4 to your computer and use it in GitHub Desktop.
tuple.ts
let tuple: [string, number];
tuple = ["hello", 10]; // OK
tuple = [10, "hello"]; // Error
let str = tuple[0]; // string
let num = tuple[1]; // number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment