This commit is contained in:
Rowan 2025-04-17 18:05:02 -05:00
parent 8d6a3fc45b
commit dfe823f53a

View file

@ -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