Edit in JSFiddle

function A() {
    
}
A.prototype.test = 1;

function B() {
    
}

B.prototype = A.prototype;

alert((new B()).test);