Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
DidYaWipe
1y ago
0 comments
Save
Share
Yes, why do we have "const" at the beginning AND end?
0 comments
2 comments · 1 top-level
top
newest
oldest
moogly
1y ago
· 1 in thread
The `as const` at the end will ensure the type of `Foo` is not widened to a `string`.
DidYaWipe
OP
1y ago
I don't know JavaScript very well, so I'll take your word for it. Seems like a language flaw to me, though. How many times should you have to say something?
j
/
k
navigate · click thread line to collapse