Regarding the "no semicolon" stuff, is there actually any way to write this type of formatting list.map(func1) .filter(func2) .map(func3) .reduce(func4); in JavaScript? As far as I know, the semicolon rules would automatically terminate the statement after map(func1). EDIT: Ah, thanks – the things I read never mentioned JS doing lookahead during ASI. This makes it a lot nicer, tbh.
In most cases[0], Js "looks" at the next line to see if it could continue the current statement, in which case no semicolon is inserted. [0] Not true for "restricted productions", which include naked returns, and some other "special" cases.
Would
return list.map(func1)
.filter(func2);
work?