Skip to content

Instantly share code, notes, and snippets.

@samvv
Created March 5, 2020 08:31
Show Gist options
  • Select an option

  • Save samvv/a6883d4aae42cd5d1a2745c00e1058ce to your computer and use it in GitHub Desktop.

Select an option

Save samvv/a6883d4aae42cd5d1a2745c00e1058ce to your computer and use it in GitHub Desktop.
Hypothetical Pattern Matching in TypeScript
function fac(n: number) {
return match (n) {
1 | 0 => 1,
_ => n * fac(n-1),
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment