之前我只知道promise.all参数是一个数组,错!!!!其实不是的,只要是可迭代对象即可
promise.all里面,参数是可迭代对象,可迭代对象有哪些呢?
- for-for循环
- 扩展操作
- Array.from
- Promise.all
- Promise.race
- 创建集合
- 创建映射
- yiled*操作符,在生成器中使用
Promise.all('fsfefef').then(re => console.log(re))
// ['f', 's', 'f', 'e', 'f', 'e', 'f']