深度学习 Kaggle新赛tensorflow海星目标检测大赛指导班(CV·目标检测)
new 模拟继承
let xiaoming = new Person( 'xiaoming' )xiaoming.a = 1xiaoming.xxx = function(){
console.log( 'xxx' )}
对象 xiaoming
具有 Person
的私有属性 + 共有属性,还有自身的属性
其中 Student
继承 Person
是构造函数与构造函数的继承(类与类的继承)
function Student( name, school ){
Person.call( this, name ) // 继承 Person 属性 === Person.bind( this ).( name )
this.school = school}