Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Dragon()
- {
- this.position = "starting point";
- }
- function AwesomeDragon()
- {
- this.awesome = true;
- }
- AwesomeDragon.prototype = new Dragon();
- function AwesomeDragonImmuneToFire()
- {
- this.immuneToFire = true;
- }
- AwesomeDragonImmuneToFire.prototype = new AwesomeDragon();
- >>> var awesome = new AwesomeDragon();
- >>> var immune = new AwesomeDragonImmuneToFire();
- >>> awesome.position = "flying above village";
- >>> immune.position;
- "starting point"
- >>> immune.awesome
- true
Add Comment
Please, Sign In to add comment