前端每日一练,大厂面试题目,涵盖前端所有知识点,每天进步一点点。HTML/CSS/Javascript/Nodejs/Typescript/ECMAScript/Vue/React/Webpack/小程序/网络/设计模式/数据结构/算法/安全/工程化/性能优化
10
stars
4
forks
source link
[JS] [2021-01-25 更新] 说下call、apply、bind三者的区别、应用以及内部实现? #17
Open
jeddygong opened 3 years ago
前言
面试中几乎每次都会问到一个js中关于call、apply、bind的问题,比如:
call、apply、bind三者的作用
call、apply、bind三者的区别
call、apply与bind的差别
call、apply的区别(参数的区别)
call、apply、bind三者的应用
1、将伪数组转化为数组
2、数组拼接,添加
3、判断变量类型
4、利用call和apply实现继承
5、多继承
call、apply、bind三者的实现
* (手写代码,更新ing)