I'm often asked why I still use CoffeeScript rather than ES6/7. Well, in truth I use both, but I do still prefer CoffeeScript for the following reasons:
- Correctly trimmed multiline strings (ES6 includes the indentation because it doesn't have significant whitespace)
- Existential operator (
a?.b;b?();a?.b?()and of coursea ? b)a ? bis more appropriate thana || bif""or0are values ofayou wish to persist(a && a.b && typeof a.b === 'function') ? a.b() : undefineddoesn't quite have the same ring to it asa?.b?()
- Significant whitespace
- (a personal preference, but since you already lay your code out sensibly why do you need the additional visual distraction of braces?)
- Convenient shorthand for common things (
->(regular non-bound function),@(this.),::(.prototype.)) into check if something in a list