detect "null"
-
@ulrik I just skimmed through the JUCE codebase and the only time where
nullis used is when you convert a JSON object with a void field to a string (which would be the case if you do something likeConsole.print(trace(array)command). I guess that's just for compatibility reasons with the JSON standard and it is still being typed internally asvoid. I can't say why it is behaving like that with aninfnumber though, as this is clearly a number type and should be treated as such (eg.isDefined(1.0/0.0)returns true).However I got this output:

so apparently assigning
voidto a field is the same as assigningundefined(which I thought were two different things), however theisDefined()check works correctly on all of them.BTW, using
infas literal is not protected, so you can do stuff like:var inf = 90; Console.print(inf); -
@Christoph-Hart Is it normal that
a[2]set tonullis throwingundefined? It's weird to me because it is actually defined asnull...EDIT: I think I have my answer...
console.log(null === undefined) // false (not the same type) console.log(null == undefined) // true (but the "same value")
-
