deno.land / x / rambda@v9.1.1 / source / forEachIndexed.spec.js

forEachIndexed.spec.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { forEachIndexed } from './forEachIndexed.js'
const list = [ 1, 2, 3 ]const iterator = (x, i) => { expect(x).toBeNumber() expect(i).toBeNumber()}
test('happy', () => { const result = forEachIndexed(iterator, list)
expect(result).toEqual(list)})
test('curried', () => { const result = forEachIndexed(iterator)(list)
expect(result).toEqual(list)})
rambda

Version Info

Tagged at
2 months ago