Build
This commit is contained in:
@ -446,8 +446,8 @@ Omit the second argument, `n`, to get the first element of the array.
|
||||
|
||||
```js
|
||||
const nthElement = (arr, n=0) => (n>0? arr.slice(n,n+1) : arr.slice(n))[0];
|
||||
// nth(['a','b','c'],1) -> 'b'
|
||||
// nth(['a','b','b']-2) -> 'a'
|
||||
// nthElement(['a','b','c'],1) -> 'b'
|
||||
// nthElement(['a','b','b'],-3) -> 'a'
|
||||
```
|
||||
|
||||
[⬆ back to top](#table-of-contents)
|
||||
|
||||
@ -317,8 +317,8 @@ squareIt([1,2,3]) // { 1: 1, 2: 4, 3: 9 }
|
||||
If the index is out of bounds, return <code>[]</code>.
|
||||
Omit the second argument, <code>n</code>, to get the first element of the array.</p>
|
||||
<pre><code class="language-js">const nthElement = (arr, n=0) => (n>0? arr.slice(n,n+1) : arr.slice(n))[0];
|
||||
// nth(['a','b','c'],1) -> 'b'
|
||||
// nth(['a','b','b']-2) -> 'a'
|
||||
// nthElement(['a','b','c'],1) -> 'b'
|
||||
// nthElement(['a','b','b'],-3) -> 'a'
|
||||
</code></pre>
|
||||
</div></div><br/><div class="card fluid"><div class="section double-padded"><h3 id="pick">pick</h3></div><div class="section double-padded">
|
||||
<p>Picks the key-value pairs corresponding to the given keys from an object.</p>
|
||||
|
||||
Reference in New Issue
Block a user