this替换

mac2022-06-30  26

1 function baseObject(){ 2 this.shit = function(){ alert('fuck'); } 3 } 4 function abc(){ 5 baseObject.call(this); 6 } 7 var o = new abc(); 8 console.log(o.shit)

转载于:https://www.cnblogs.com/qzsonline/archive/2012/05/23/2514998.html

最新回复(0)