35

「干货」细说 call、apply 以及 bind 的区别和用法

 5 years ago
source link: https://juejin.im/post/5c493086f265da6115111ce4
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
前言 上一篇文章 《「前端面试题系列4」this 的原理以及用法》 中,提到了 call 和 apply。 它们最主要的作用,是改变 this 的指向。在平时的工作中,除了在写一些基础类,或者公用库方法的时候会用到它们,其他时候 call 和 apply 的应

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK