Created
December 13, 2015 13:34
-
-
Save sampathsl/dc7580c39dd7513d2a41 to your computer and use it in GitHub Desktop.
ES6 Class Support
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 Vehicle { | |
constructor(){ | |
this.type = 'Vehicle'; | |
} | |
getBrand(val){ | |
console.log('Type: ' + val + ', This is a ' + this.type); | |
} | |
} | |
class Car extends Vehicle{ | |
constructor(){ | |
super(); | |
this.type = 'Car'; | |
} | |
} | |
let vehicle = new Vehicle(); | |
vehicle.getBrand('Toyota'); | |
let car = new Car(); | |
car.getBrand('BMW'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment