Skip to content

Instantly share code, notes, and snippets.

@davidlygagnon
Last active April 20, 2019 00:06
Show Gist options
  • Save davidlygagnon/36d2d88305d77c0e4aee7877edf15040 to your computer and use it in GitHub Desktop.
Save davidlygagnon/36d2d88305d77c0e4aee7877edf15040 to your computer and use it in GitHub Desktop.
Coffeescript shorthand property instantiation with super() call
// Coffeescript
class SportCar extends Car
constructor: (@model, @wheelsProperties) ->
super()
class Car
constructor: () ->
computeWheelMaintenance()
computeWheelMaintenance: ->
if @wheelsProperties.shouldDoMaintenance
# do maintenance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment