Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gunar/recur-fn
Recursive Arrow Functions for JavaScript
https://github.com/gunar/recur-fn
Last synced: 6 days ago
JSON representation
Recursive Arrow Functions for JavaScript
- Host: GitHub
- URL: https://github.com/gunar/recur-fn
- Owner: gunar
- Created: 2017-07-11T23:53:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-18T16:39:23.000Z (over 7 years ago)
- Last Synced: 2024-10-28T00:23:15.069Z (9 days ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Recursive Arrow Functions for JavaScript
## Installation
```
npm install recur-fn
```## Usage
```js
const rec = require('recur-fn')const factorial = rec((f,n) => (n>1 ? n*f(n-1) : n))
factorial(6) // 720
```## Acknowledgement
Inspired by a [post on esdiscuss.org on recursive arrow functions](https://esdiscuss.org/topic/recursive-arrow-functions).
## License
MIT [http://gunar.mit-license.org]()