Having very different semantics hiding under identical syntax is still a design fault with the language though, especially considering that Javascript's adherence to Java syntax is deliberate not accidental.
I really don't blame programmers for getting confused by this.
I really don't blame programmers for getting confused by this.