UNPKG

aureooms-js-array

Version:

array manipulation code bricks for JavaScript

19 lines (10 loc) 229 B
export function compress ( iterable, selector, out ) { var i, j; j = Math.min( iterable.length, selector.length ); for ( i = 0 ; i < j ; ++i ) { if ( selector[i] ) { out.push( iterable[i] ); } } return out; }