Ye Xi
Results
2
comments of
Ye Xi
> > > 直接递归处理 > > > ```js > > > Promise.retry = function (promiseFn, times = 3) { > > > return new Promise((resolve,reject)=> promiseFn().then(res=>resolve(res)).catch(err=>times ? Promise.retry(promiseFn, times-1) :...
**es6实现** ```javascript function normalize(str) { let obj = {}; let arr = str.split(/[\[\]]/g).filter(Boolean); arr.reduce((acc, cur) => { while (acc.children) { acc = acc.children; } acc.value = cur; acc.children = {};...