3 ms·
> Honestly I'm shocked at the defense of this practice (of ASI "abusage") Devil's advocate here: could one argue that taking advantage of ASI everywhere can ma
by tzs 15y ago
> Honestly I'm shocked at the defense of this practice (of ASI "abusage")
Devil's advocate here: could one argue that taking advantage of ASI everywhere can make it safer, because it forces you to be fully aware of ASI?
Suppose you always put in semicolons. You can STILL get bitten by ASI. The classic example is
return
{
...stuff...
};
ASI is going to put a semicolon right after the return and break your code.
Someone who strives to take advantage of ASI everywhere they can is going to remember that ASI is going to apply on that return, and they will code the above so as to take it into account.
- ahoge 15y agoThere will be no issues if you follow JSLint's/Crockford's suggestions. Furthermore, it simplifies the language drastically. I really don't want to deal with this kind of stuff: https://github.com/twitter/bootstrap/issues/3057#issuecomment-5140311 https://github.com/twitter/bootstrap/issues/3057#issuecommen... (Just like I don't want to deal with those massive ==/!= tables.)