```
let util = require('util');
function A(){
this.name = 'h123';
}
A.attr= 'a';
A.prototype.method = function(){
console.log('methodA');
};
function B(){
A.call(this); //能继承A产生对象的属性
}
util.inherits(B,A); //继承A产生对象的方法 //B.prototype.__proto__ = A.prototype
console.log(B.attr); //undefined
let b = new B();
b.method(); //methodA
console.log(B.prototype.constructor); //仍然指向B构造函数
console.log(b.name); //h123
```