Snippet format update
To match the starter (for the migration)
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
### unfold
|
||||
---
|
||||
title: unfold
|
||||
tags: function,array,intermediate
|
||||
---
|
||||
|
||||
Builds an array, using an iterator function and an initial seed value.
|
||||
|
||||
@ -17,4 +20,4 @@ const unfold = (fn, seed) => {
|
||||
```js
|
||||
var f = n => (n > 50 ? false : [-n, n + 10]);
|
||||
unfold(f, 10); // [-10, -20, -30, -40, -50]
|
||||
```
|
||||
```
|
||||
Reference in New Issue
Block a user