<script type="text/javascript"> function Animal() { this.name = "Animal"; this.Say = function () { console.log(this); console.log(this.name); } } function Cat() { this.name = "Cat"; } var animal = new Animal(); var cat = new Cat(); //animal.Say(); animal.Say.call(cat);是不是 .調用animal.Say里面的this已經切換到指向cat對象,所以console.log(this);打印了catconsole.log(this.name); 打印了cat這個call好懵逼呀,到底是什么東西..我實在搞不懂能不能來個例子 或者給我解釋一下 , ,謝謝了
js中call的詳細介紹,這代碼塊是什么意思
元芳怎么了
2019-03-15 18:13:07