Last active
April 29, 2020 04:21
-
-
Save drinkmorewaters/57945c2ee0d2323b97d6516f3ab5a910 to your computer and use it in GitHub Desktop.
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
class Cars { | |
constructor(type, price, condition, color, location) { | |
this.type = type | |
this.price = price | |
this.condition = condition | |
this.color = color | |
this.location = location | |
} | |
sellCar(n) { | |
console.log(n.type, 'has been sold.') | |
return this | |
} | |
} | |
class Carz extends Cars { | |
named(n) { | |
console.log(n.type) | |
return this | |
} | |
} | |
let newCar = new Carz('Ford', 25000, 'Fair', 'Red', 'Sydney') | |
let cars = new Carz() | |
cars.named(newCar).sellCar(newCar) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment