Skip to content

Instantly share code, notes, and snippets.

@vinibaggio
Created July 7, 2012 23:22
Show Gist options
  • Save vinibaggio/3068537 to your computer and use it in GitHub Desktop.
Save vinibaggio/3068537 to your computer and use it in GitHub Desktop.
function Car() {
this.wheels = arguments[0];
this.type = arguments[1];
}
function SportsCar() {
this.speed = arguments[0];
}
SportsCar.prototype = new Car();
SportsCar.prototype.constructor = SportsCar;
var ferrari = new SportsCar('300km/h');
var fuscaoPreto = new Car(4, 'motor');
console.log(ferrari);
console.log(fuscaoPreto);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment