Last active
April 20, 2019 00:06
-
-
Save davidlygagnon/36d2d88305d77c0e4aee7877edf15040 to your computer and use it in GitHub Desktop.
Coffeescript shorthand property instantiation with super() call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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