This is just another method.
A.prototype = B.prototype;
Thus, any changes to the prototype Bwill also change the prototype A, because they are the same object, and one that should have undesirable side effects.
A.prototype = new B();
Using this, we also perform inheritance with prototypes.
A a B, A B.
# 1:
function A() { console.log("A!")}
function B() { console.log("B!")}
A.prototype = new B();
a = new A();
B.bb=function (){alert('');}
console.log(a.bb())
:
function A() { console.log("A!")}
function B() { console.log("B!")}
A.prototype = B.prototype;
a = new A();
B.prototype.bb=function (){alert('');}
console.log(a.bb())