JavaScript继承和构造函数属性
function a() {}function b() {}function c() {}b.prototype = new a();c.prototype = new b();console.log((new a()).constructor);
//a()console.log((new b()).constructor); //a()console.log((new c()).constructor); //a()console.log(new a() instanceof a); //trueconsole.log(new b() instanceof b); //trueconsole.log(new c() instanceof c); //true
(new c()).constructor
a()
Object.getPrototypeOf(new c())
a{ }
instanceof
new c()
c?
呼啦一阵风
随时随地看视频慕课网APP
相关分类