I am not experienced with javascript, so I don't understand this argument. Can someone please confirm the following, or explain what's going on? Here is what I understand: 1. Javascript will add a phantom semicolon at the end of each line if it seems like you need it, for some definition of seems like. To me, it sounds like this is so that new HTML writers in '98 wouldn't see their pages blow up when they forgot a se…
a = b
++c
This becomes: a = b;
++c;
and NOT: a = b++;
c;
There are other, odd gotcha's, but this is the one being discussed.I believe the issue with the bang (!) operator is that it's being considered as a binding de-reference of function objects. See here: https://mail.mozilla.org/pipermail/es-discuss/2010-July/0114...
Therefore, the problem with the code would be that an automatic semi-colon would not be inserted and the code, which is currently:
clearMenus()
!isActive && $parent.toggleClass('open')
Would become: clearMenus()!isActive && $parent.toggleClass('open');
Instead of: clearMenus();
!isActive && $parent.toggleClass('open');
That was my understanding, at any rate.