【一篇终结你的困惑】JavaScript中call()、apply()、bind()的区别

call()、apply()、bind()是用来改变this的指向的。html 一 举个例子浏览器 一个叫喵喵的猫喜欢吃鱼,一个叫汪汪的小狗喜欢啃骨头,用代码实现以下:app var cat = { name:"喵喵", eatFish:function(param1,param2){ console.log("吃鱼"); console.log("this的指向=>"); c
相关文章
相关标签/搜索