Skip to content

Instantly share code, notes, and snippets.

@davidlygagnon
Last active April 20, 2019 00:06
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