zjlovezj

Results 2 issues of zjlovezj

The Readme says > Sometimes it is necessary to transform a value before validation, possibly to coerce the value or to sanitize it in some way. To do this add...

[源码](https://github.com/weolwo/promise-learn/blob/e883edf7097601f6b09b0411db2aa1347ebefec9/lib/promise_class.js#L15) ` that.callbacks = [] //保存待执行的回调函数 ,数据结构:{onResolved(){},onRejected(){}}` 我在这里困惑了许久,为什么这里是数组,而不是单单一个 {onResolved(){},onRejected(){}} 对象。 后来终于想到下面的场景是需要 callbacks 是数组的。 ```js let p1 = new Promise((resolve, reject) => { resolve("p1"); }); // 是否立接在new Promise后面,没有影响。但new Promise以后可以再做别的 p1 .then((v)...