Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Last active March 29, 2023 18:59
const validGreeting: Greeting = `hi Jeff!` //
// ✅ Result:
// note that the type of `validGreeting` is the union `"hi Jeff!" | "hi Maria!`
const invalidGreeting: Greeting = `bye Jeff!` //
// ❌ Result:
// Type '"bye Jeff!"' is not assignable to type '"hi Jeff!" | "hi Maria!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment