Travis build: 1380

This commit is contained in:
30secondsofcode
2018-01-24 11:23:46 +00:00
parent 315780ade3
commit fdf21726a9
2 changed files with 36 additions and 1 deletions

View File

@ -87,6 +87,15 @@ average(1, 2, 3);
</details>
### Adaptor
<details>
<summary>View contents</summary>
* [`unary`](#unary)
</details>
### 📚 Array
<details>
@ -586,6 +595,30 @@ arrayMax([1, 2, 3]); // 3
<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

File diff suppressed because one or more lines are too long