Old style prototype chaining
Old style prototype chaining
by justinwyllie
JavaScript
var A = function() {
}
A.prototype.hello = alert('hello');
var B = function() {
}
B.prototype = new A();
b = new B()
console.log(b)
b.hello()
by justinwyllie
var A = function() {
}
A.prototype.hello = alert('hello');
var B = function() {
}
B.prototype = new A();
b = new B()
console.log(b)
b.hello()