
es6
资深柠檬精
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
手写promise
手写promise class SxPromise{ static PENDING = 'pending' static FULFLED = "success" static REJECT = 'failed' constructor(fun){ this.status = SxPromise.PENDING this.res = null this.fulLIst = [] this.failLIst = []原创 2021-12-09 11:25:31 · 188 阅读 · 0 评论 -
apply和call函数的区别(bind)
apply和call函数的区别 相同点:call和apply 都是用来修改函数中this的指向问题 想要修改this 的指向,那么必然有一个this修改后的指向,而函数必然后关系到传参问题,对于除了第一个参数的后面的参数: 1.call方法可以传给该函数的参数分别作为自己的多个参数; 2.apply方法必须将传给该函数的参数合并成一个数组作为自己的一个参数 例如:将函数内this指向由前面person.sayHobby转变为后面的person var name = 'nihao'; var person =原创 2020-10-13 09:54:10 · 132 阅读 · 0 评论 -
es6新增语法总结
es6新增语法总结 let(变量)和const(常量) 相比于var: 1.拥有了块级作用域 2.必须先申明在使用 3.let变量不会压入window中是独立的 -解构赋值 -箭头函数 -字符串魔板字面量 -默认参数 -导出 exporting in Common.js——moudle.export exporting in es6——export or export default -新增函数 1.Array.form()——把伪数组转变为数组 2.find()方法和findIndex()方法 3.in原创 2020-10-12 20:20:59 · 318 阅读 · 0 评论