Skip to content

Instantly share code, notes, and snippets.

@StevenJL
Created January 8, 2025 22:58
Show Gist options
  • Save StevenJL/7d80bcaf8b75ad58c8e6854f5db02bd2 to your computer and use it in GitHub Desktop.
Save StevenJL/7d80bcaf8b75ad58c8e6854f5db02bd2 to your computer and use it in GitHub Desktop.
TypeScript array conditional splatting quirk
// Consider an array of typed elements
type actions = "fart" | "burp" | "poop" | "barf"
let arrayOfActions: actions[] = [
"fart",
"burp",
"poop"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment