Update sampleSize.md

This commit is contained in:
Angelos Chalaris
2017-12-31 14:10:46 +02:00
committed by GitHub
parent 1456993dfd
commit b6ebf3b97e

View File

@ -4,7 +4,7 @@ Gets `n` random elements at unique keys from `array` up to the size of `array`.
Shuffle the array using the [Fisher-Yates algorithm](https://github.com/chalarangelo/30-seconds-of-code#shuffle). Shuffle the array using the [Fisher-Yates algorithm](https://github.com/chalarangelo/30-seconds-of-code#shuffle).
Use `Array.slice()` to get the first `n` elements. Use `Array.slice()` to get the first `n` elements.
Omit the second arguent, `n` to get only one element at random from the array. Omit the second argument, `n` to get only one element at random from the array.
```js ```js
const sampleSize = ([...arr],n=1) => { const sampleSize = ([...arr],n=1) => {