Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
dspillett
on July 24, 2023
|
parent
|
context
|
favorite
| on:
Nulls Nullified (2005)
Worse: with JSON NULL is considered a type not a value of other types, which can make validating nullable values with JSON-Schema a royal pain.
bazoom42
on July 24, 2023
[–]
JSON does not define a type system, but javascript defines null as the only value of the null type. This works fine in eg typescript since you can use a type union of null and any other type, if you want to indicate a nullable value.
Izkata
on July 24, 2023
|
parent
|
next
[–]
Don't forget in addition to null, javascript has undefined and undefined.
(the value undefined and the property-does-not-exist undefined)
VMG
on July 24, 2023
|
parent
|
prev
[–]
but don't forget that `typeof null === 'object'` :)
ElectricalUnion
on July 24, 2023
|
root
|
parent
[–]
They're null pointer objects /s
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: