Conversation
Edited 7 months ago
contains javascript; not screen-reader friendly
Show content

I’ve undergone a javascript rite of passage today: I’ve used my first load-bearing semicolon

const HIDDEN = [
    // ...
]; // do not remove this semicolon!

(function() {
1
0
2
contains javascript; not screen-reader friendly
Show content

@kasdeya common convention in this scenario is to put the semicolon at the beginning of the line that actually needs it to resolve the ambiguity, as this won't *only* break if the semicolon is removed, it also would break if something else is inserted between the semicolon and the immediately invoked function expression

1
0
1
re: contains javascript; not screen-reader friendly
Show content

@tempest ohh - thank you! that is really good to know, and it makes a lot of sense to put the semicolon there, now that I think about it

0
0
0