function Animal (){
this.name = 'a'
return 1
}
const animal1 = new Animal() // 正常的Animal 实例
function Animal (){
this.name = 'a'
return [1,2,3]
}
const animal1 = new Animal() // [1,2,3]
function Animal (){
this.name = 'a'
return 1
}
const animal1 = new Animal() // 正常的Animal 实例
function Animal (){
this.name = 'a'
return [1,2,3]
}
const animal1 = new Animal() // [1,2,3]
本文标题:new 的返回值对 new 结果的影响
本文链接:https://www.haomeiwen.com/subject/ynyhpqtx.html
网友评论