Fibonacci and random

This commit is contained in:
Angelos Chalaris
2017-11-30 19:45:56 +02:00
parent d9c4f9234f
commit 0893f79360
4 changed files with 62 additions and 2 deletions

View File

@ -0,0 +1,7 @@
### Randomize order of array
Use `sort()` to reorder elements, utilizing `Math.random()` to randomize the sorting.
```js
var randomizeOrder = arr => arr.sort( (a,b) => Math.random() >= 0.5 ? -1 : 1)
```