My go-to for testing simple JS is Adobe’s ExtendScript Toolkit. The ESTK (and ExtendScript in general) uses an older version of SpiderMonkey (which supports E4X).
It looks like the behavior there is different than what the JSFiddle shows. Maybe it was a bug which has been fixed in more modern runtimes. Don’t know… Either way, for this case, I guess I’ll just always initiate the prefix as null. On Feb 11, 2016, at 1:22 AM, Alex Harui <aha...@adobe.com> wrote: >> >> Actually, I just did some tests with JS and it looks like I’m not totally >> clear on how JS handles null and undefined in comparisons: >> var a = ""; >> alert(a==null)//false >> alert(""==null)//true > > I did not get this in JSFiddle.