aureooms-js-array
Version:
array manipulation code bricks for JavaScript
23 lines (12 loc) • 298 B
JavaScript
import test from 'ava';
import * as array from '../../src';
test( "each", t => {
var a, b, c;
a = [ 0, 1, 2, 3, 4 ];
c = [];
array.each( function ( item, index, b ) {
c.push( item * index );
t.deepEqual( b, a, index );
}, a , 1, 4 );
t.deepEqual( c, [ 1, 4, 9 ], "output");
});