5 ms·
There's a good discussion over here: https://github.com/airbnb/javascript/issues/44 https://github.com/airbnb/javascript/issues/44
by cocoflunchy 12y ago
There's a good discussion over here: https://github.com/airbnb/javascript/issues/44 https://github.com/airbnb/javascript/issues/44
- pjc50 12y agoOh god. Javascript's optional semicolon really has inflicted a lot of damage, hasn't it?
- mattmanser 12y agoI remember when I used to rave on at my colleagues that it was amazing back in 2005. How wrong I was.
- bshimmin 12y agoHorrible, isn't it? Baffling, quasi-random punctuation inserted to prevent random errors caused by poor design choices intended to make programmers' lives easier.
- bpicolo 12y agoYou lose the return value over (function(){})(). That's an awful recommendation.
- _harry 12y agoYup! We only recommend !function(){}(); for a module where you just need your function to run. If you rely on the return value use (function(){})(); or (function(){}()); (more on this: https://github.com/airbnb/javascript/issues/21 https://github.com/airbnb/javascript/issues/21)