-
-
Save dberringer/585207 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.color = 'red'; | |
//alert('car was made'); | |
} | |
function Truck () { | |
// how do I call the parent constructor (i.e. make the alert box appear) | |
this.color = 'blue'; | |
} | |
Truck.prototype = new Car(); | |
Truck.prototype.wheels = 4; | |
t = new Truck(); | |
alert(t.wheels); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment