biubiupiu1
biubiupiu1
````javascript let x = new Promise((resolve, reject) => { resolve( new Promise((resolve, reject) => { resolve(2); }) ); }).then(res => { console.log(res); }); ```` 我发现一个问题就是,这个在浏览器的Promise中,和这里实现的Promise是不一致的,想问下这是新规范吗
> 这里不支持多层then链式调用(then中可返回新的promise进行异步流控制),不支持finally,我写了个版本,多多指教 > http://www.a4z.cn/fe/2019/04/18/weekly-fe-interview/ ``` then: function (onFulfilled, onRejected) { var _this = this if (_this.promiseStatus == 'pending') { return new Promise2(function (resolve, reject) { onFulfilled && (_this.onFulfilledCb = function...
> 不使用 call apply方法 > > ``` > Function.prototype.bind = function() { > const context = arguments[0] || window > const argument = Array.from(arguments).splice(1, arguments.length - 1) > return (()=>{...