5 ms·
This was a nice read, well-written and informative! I could add that in my mental model, the reason that an object property with an undefined value is differen
by nanofus 2y ago
This was a nice read, well-written and informative!
I could add that in my mental model, the reason that an object property with an undefined value is different from an actually undefined property, is that since JS objects are basically key/value maps, there is a difference between a key existing with an undefined value and the key itself not existing at all.
- langcss 2y agoThe Json serialisation and serialisation of undefined fields is a bug then? Since it changes the meaning.
- the_gipsy 2y agoNo. JSON is a subset of JavaScript.
- mirekrusin 2y agoJson doesn’t have notion of undefined value anywhere, only null and absence can be encoded.
- afiori 2y agoAlso if missing and undefined where the same it would change how prototype inheritance worked (maybe for the better)
- deleted 2y ago[deleted]