Created
July 7, 2012 23:22
-
-
Save vinibaggio/3068537 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
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