Skip to content

Instantly share code, notes, and snippets.

@sampathsl sampathsl/index4.js
Created Dec 13, 2015

Embed
What would you like to do?
ES6 Class Support
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
You can’t perform that action at this time.