Travis build: 1380
This commit is contained in:
33
README.md
33
README.md
@@ -87,6 +87,15 @@ average(1, 2, 3);
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### Adaptor
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>View contents</summary>
|
||||||
|
|
||||||
|
* [`unary`](#unary)
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
### 📚 Array
|
### 📚 Array
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
@@ -586,6 +595,30 @@ arrayMax([1, 2, 3]); // 3
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#table-of-contents)
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
|
---
|
||||||
|
## Adaptor
|
||||||
|
|
||||||
|
### unary
|
||||||
|
|
||||||
|
Creates a function that accepts up to one argument, ignoring any additional arguments.
|
||||||
|
|
||||||
|
Call the provided function, `fn`, with just the first argument given.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const unary = fn => val => fn(val);
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Examples</summary>
|
||||||
|
|
||||||
|
```js
|
||||||
|
['6', '8', '10'].map(unary(parseInt)); // [6, 8, 10]
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#table-of-contents)
|
||||||
|
|
||||||
---
|
---
|
||||||
## 📚 Array
|
## 📚 Array
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user