HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by cat-whisperer | Hacker News Reader
Parent
Full thread
cat-whisperer
·
I don’t get this? why do I need to say as const?
View on HN
afdbcreid
·
`as const` is a special annotation that lets the TypeScript compiler infers the more specific type `["foo"]` instead of `string[]`.
halflife
·
As const creates a typed tuple instead of a typed array
Reply on news.ycombinator.com