- 博客(3)
- 收藏
- 关注
原创 Promise的自定义实现(手写)
// 声明构造函数 function Promise(executor) { // 设置初始状态和值 this.PromiseState = 'pending'; this.PromiseResult = undefined; // 回调函数的属性 this.callbacks = []; let _this = this; // reslove函数声明 function res(data) { // 让状态只能被修改一次..
2021-06-10 14:10:23
188
原创 ES6新特性之let const
ES6新特性之let const 1 let关键字 1.1 let声明变量形式: let a; //声明一个变量 let b,c,d; //同时声明多个个变量 let e = 1; //声明一个变量同时赋值 let f = 2, g = 'string', h = []; //声明多个变量同时赋值 1.2 let 关键字用来声明变量,使用 let 声明的变量有几个特点: (1) 不允许重复声明 let str = 'hhh'; let str
2021-05-23 21:44:31
558
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人