feat: update readme

add-license-1
xuwu 2021-03-15 07:34:00 +08:00
parent c1cb5f8269
commit f077f86d59
1 changed files with 29 additions and 0 deletions

View File

@ -23,8 +23,31 @@
### 今日原题
第六题:[实现一个 chunk 函数](https://github.com/KieSun/fucking-frontend/issues/8)
```js
/**
* @param input
* @param size
* @returns {Array}
*/
_.chunk(['a', 'b', 'c', 'd'], 2)
// => [['a', 'b'], ['c', 'd']]
_.chunk(['a', 'b', 'c', 'd'], 3)
// => [['a', 'b', 'c'], ['d']]
_.chunk(['a', 'b', 'c', 'd'], 5)
// => [['a', 'b', 'c', 'd']]
_.chunk(['a', 'b', 'c', 'd'], 0)
// => []
```
第五题:[Promise.all 错误处理](https://github.com/KieSun/fucking-frontend/issues/6)
<details>
异步请求通过 Promise.all 处理,怎么让其中失败的所有请求重试。
```js
@ -32,6 +55,10 @@ Promise.all([A, B, C, D])
// 4 个请求完成后发现 AD 请求失败了,如果让 AD 请求重试
```
[答案](./Answer/1%20~%2010/5.md)
</details>
第四题:[消息队列](https://github.com/KieSun/fucking-frontend/issues/5)
<details>
@ -40,6 +67,8 @@ Promise.all([A, B, C, D])
请实现当用户依次点击 A、B、C、A、C、B 的时候,最终获取的数据为 ABCACB。
[答案](./Answer/1%20~%2010/4.md)
</details>
第三题:[请按照用例实现代码](https://github.com/KieSun/fucking-frontend/issues/3)