Skip to content

Instantly share code, notes, and snippets.

@davidlygagnon
Last active April 19, 2019 23:43
Show Gist options
  • Save davidlygagnon/0e68b1981b06ecab30b769bef93cdd73 to your computer and use it in GitHub Desktop.
Save davidlygagnon/0e68b1981b06ecab30b769bef93cdd73 to your computer and use it in GitHub Desktop.
CoffeeScript shorthand instance property initialization
// (1) Coffeescript
class Car
constructor: (@model) ->
// (2) JavaScript (ES6)
class Car {
constructor(model) => {
this.model = model
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment