Created
September 24, 2018 08:34
-
-
Save przemyslawjanpietrzak/31e46f350e73d07de99ccd8e6ff66fd4 to your computer and use it in GitHub Desktop.
tuple.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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