I'm attempting this in coffeescript:
$( element ).mousedown( aFunction ).mouseup( anotherFunction );
I'm trying to work out a way to make use of indents so that something like the following will return what's about:
$ element
.mousedown aFunction
.mouseup anotherFunction
But to no avail, are there any recommendations for chaining in coffeescript?
As of today, January 2020, CoffeeScript is completely dead on the market (though the GitHub repository is still kind of alive).
CoffeeScript is a programming language that compiles to JavaScript. It adds syntactic sugar inspired by Ruby, Python, and Haskell in an effort to enhance JavaScript's brevity and readability. Specific additional features include list comprehension and destructuring assignment.
One crucial difference between the two languages is that TypeScript is the superset of JavaScript while CoffeeScript is a language which is an enhanced version of JavaScript. Not just these two languages but there are other languages such as Dart, Kotlin, etc. which can be compiled into JavaScript.
I'm sure you don't want to use parenthesis, but...
$("#element")
.mousedown(aFunction)
.mouseup(anotherFunction)
Compiles to
$("#element").mousedown(aFunction).mouseup(anotherFunction);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With