:( JavaScript woes.

In JS: a = {b:0}; (a.b? 1:2) gives 2 but a = {b:1}; (a.b? 1:2) gives 1.
Wow JS.