Skip to content

Instantly share code, notes, and snippets.

let curr = 0;
const circle (arr, dir) => {
curr = (curr + arr.length + (dir ? -1 : 1)) % arr.length;
}
@PatrickEifler
PatrickEifler / handyFunctions
Last active July 30, 2016 17:22
Handy Function Examples
# Easy Recursive Functions
## Factorial
```
const factorial = n => n > 1 ? n * factorial(n-1) : 1;
```
## Fibonacci
```