Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
joegibbs
5 months ago
|
parent
|
context
|
favorite
| on:
I Hate "Unknown"
Why null as any[]? Can’t it just be []?
h_tbob
5 months ago
[–]
Actually, if you do that you get:
"Property 'email' does not exist on type 'never'.ts(2339)"
When you do
{{customer.email}}
alpinisme
5 months ago
|
parent
[–]
Use `[] as TheRealType`. `any` is the real wart on the language, not unknown, which adds safety by preventing you from doing anything dangerous with it.
Consider applying for YC's W25 batch! Applications are open till Nov 12.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: