Skip to content

Commit

Permalink
Merge pull request #27 from WaldoJeffers/1.5.0
Browse files Browse the repository at this point in the history
GitBook: [1.5.0] 2 pages modified
  • Loading branch information
WaldoJeffers authored Dec 1, 2018
2 parents 11f47bd + 176357c commit 3b6dd1d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@

* [example use cases](guides/example-use-cases.md)
* [checkGuards](guides/checkguards.md)

11 changes: 6 additions & 5 deletions docs/api-reference/take.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,35 @@ take :: (Integer count, Array input) => Array output
Available since v1.5.0
{% endhint %}

### description
## description

`take` returns a new array only keeping the first `count` elements of the input array. If `count` is _negative_, `take` returns the last `count` elements.

[See source code](https://github.com/WaldoJeffers/conductor/blob/master/src/take.js)

### examples
## examples

#### using a positive count argument
### using a positive count argument

```javascript
import { take } from 'conductor'

take(2, [1, 2, 3]) // [1, 2]
```

#### using a negative count argument
### using a negative count argument

```javascript
import { take } from 'conductor'

take(-2, [1, 2, 3]) // [2, 3]
```

#### using a count argument greater than the array's length
### using a count argument greater than the array's length

```javascript
import { take } from 'conductor'

take(100, [1, 2, 3]) // [1, 2, 3]
```

0 comments on commit 3b6dd1d

Please sign in to comment.