repeat
This commit is contained in:
parent
8d6a3fc45b
commit
dfe823f53a
1 changed files with 2 additions and 2 deletions
|
@ -142,11 +142,11 @@ export const reduce = curry(dispatch(['fantasy-land/reduce', 'reduce'],
|
||||||
(f, acc, xs) => xs.reduce(f, acc)
|
(f, acc, xs) => xs.reduce(f, acc)
|
||||||
))
|
))
|
||||||
|
|
||||||
export const repeat = curry((n, f) => {
|
export const repeat = curry((n, x) => {
|
||||||
const results = []
|
const results = []
|
||||||
|
|
||||||
for (let i = n; i > 0; i--) {
|
for (let i = n; i > 0; i--) {
|
||||||
results.push(f())
|
results.push(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
Loading…
Add table
Reference in a new issue