前端面试题5(手写题)
type
status
date
slug
summary
tags
category
icon
password
1. 请编写一个函数,实现深浅拷贝功能。
深拷贝:
浅拷贝:
2. 请编写一个函数,实现防抖功能。
3. 请编写一个函数,实现节流功能。
4. 请编写一个函数,实现柯里化功能。
5. 手写 Object.create
首先我们得理解
Object.create
的定义:创建一个新对象,使用现有对象作为新创建对象的原型。6. 手写 instanceof 方法
7. 手写 new 方法
- 创建一个新对象
- 将对象的原型设置成构造函数的原型
- 绑定 this 指向新对象,并执行构造函数
- 返回新对象
8. 手写 Promise
9. 手写 call 方法
10. 手写 apply 方法
11. 手写 bind 方法
Loading...