Skip to main content
Module

x/rambda/times.js

Faster and smaller alternative to Ramda
Go to Latest
File
import { map } from './map'import { range } from './range'
export function times(fn, howMany){ if (arguments.length === 1) return _howMany => times(fn, _howMany) if (!Number.isInteger(howMany) || howMany < 0){ throw new RangeError('n must be an integer') }
return map(fn, range(0, howMany))}