$ whois coffeescript
CoffeeScript
first released in 2009 · by Jeremy Ashkenas
$ guessprog --inspect coffeescript
- year
- 2009
- paradigm
- multi paradigm
- family
- other
- memory
- automatic gc
- binding
- dynamic
- safety
- weak
COFFEESCRIPT(7)
- AUTHORS
- Jeremy Ashkenas
- HISTORY
- Jeremy Ashkenas, also the author of Backbone.js and Underscore.js, started CoffeeScript in late 2009 as "a little language that compiles into JavaScript". Borrowing from Ruby and Python, it replaced braces with significant indentation and added arrow functions, classes, comprehensions, string interpolation and destructuring. The compiler was first written in Ruby and soon rewritten in CoffeeScript. Many of its ideas, such as arrow functions, classes and destructuring, later made their way into JavaScript with ES2015.
- USAGE
- Largely legacy today. It was very popular in the early 2010s, shipping by default with Ruby on Rails 3.1, but most projects have since moved to modern JavaScript or TypeScript.
- SEE ALSO
- CoffeeScript on Wikipedia ↗
square = (x) -> x * x
evens = (square n for n in [1..10] when n % 2 is 0)
console.log evens # [4, 16, 36, 64, 100]
class Greeter
constructor: (@name) ->
greet: -> "Hello, #{@name ? 'stranger'}!"
console.log new Greeter("Coffee").greet()
console.log new Greeter().greet()