deno.land / x / rambda@v9.1.1 / source / times.js

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
import { isInteger } from './_internals/isInteger.js'import { map } from './map.js'import { range } from './range.js'
export function times(fn, howMany){ if (arguments.length === 1) return _howMany => times(fn, _howMany) if (!isInteger(howMany) || howMany < 0){ throw new RangeError('n must be an integer') }
return map(fn, range(0, howMany))}
rambda

Version Info

Tagged at
2 months ago