Skip to content

Instantly share code, notes, and snippets.

@tswistak
Created July 30, 2018 06:11
Show Gist options
  • Save tswistak/0f3a8a7dc31bfb9b9f4b46670b78ceac to your computer and use it in GitHub Desktop.
Save tswistak/0f3a8a7dc31bfb9b9f4b46670b78ceac to your computer and use it in GitHub Desktop.
TypeScript 3.0, listing 3
type Strings = [...string];
type Empty = [];
const c1: Strings = ['a', 'b'];
const c2: Strings = [];
const c3: Empty = [];
const c4: Empty = ['a', 'b']; // invalid type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment