maiy's blog

手写常用的js方法(call apply bind new等)

Javasript 前端
起因在项目开发中,经常使用apply,call以及bind来改变js的this指针的指向,但是使用的时候只知道其用处,并不知道其原理,这样对于使我们编程时对js的理解并不够深入,今天我们来手写几个js常用的方法,有助我们深入理解js编程。 applyapply方法接收两个参数,第一个是thi ...
Read more

手写简单Promise

Javasript 前端 Promise ES6
参考 什么是PromisePromise是Javascript异步编程的一种解决方案,主要是解决地狱回调问题。但Promise具体原理是怎样的?我们今天就来手写一个简单的Promise。 一、Promise一共有三种状态初始状态是pending,成功是fulfilled,失败时rejecte ...
Read more

Hello World

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer ...
Read more
Prev Next