JavaScript | Prototypes
http://www.peterkropff.de/site/javascript/prototypen.htm http://www.w3schools.com/js/js_object_prototypes.asp http://www.documentroot.net/allgemein/js-tutorial-klassen-prototypen-oop or the short way: # function A() { this.x = 5; } # function B() { this.y = 6; } # B.prototype = new A(); # var b = new B(); # alert(b.x); // => 5 (huge thanx to Manuel Bleichner)
You must be logged in to post a comment.