153
Trying to understand JSON…
(sopuli.xyz)
Post funny things about programming here! (Or just rant about your favourite programming language.)
That’s what undefined is for
Undefined is not part of JSON specification. It’s also not a thing in Java.
Yeah my bad, it would still require the java dev to leave the keys out
To be fair, just because
obj.foo
is undefined, that doesn’t mean the key is missing. It could also be assigned the value undefined.const obj = { foo: undefined }
vsconst obj = {}