11 ms·
I understand the frustration with this comment, but the clincher for me on the whole anti semi-colon crowd was at this article: http://www.wordsbyf.at/2011/10/
by chris_wot 15y ago
I understand the frustration with this comment, but the clincher for me on the whole anti semi-colon crowd was at this article:
http://www.wordsbyf.at/2011/10/31/i-dont-write-javascript/ http://www.wordsbyf.at/2011/10/31/i-dont-write-javascript/
He says he doesn't use semicolons, except that it caused issues for those who concatenation scripts so he adds a semicolon to the end of the js file. But, lo! This causes issues for those who use the following pattern:
(function() {
// Le code
})()
This has the potential to cause syntax errors when you execute two anonymous functions after each other. Instead of adding a semi-colon to the end, he "works around" the issue by abusing JavaScript like so:
!function() {
// Le code
}()
For fucks sake indeed!
- tptacek 15y ago(function() { // Le code })() !function() { // Le code }() YOU'RE RIGHT. I'M HORRIFIED.