UNPKG

@extra-array/reject-update

Version:

Discards values which pass a test.

10 lines (9 loc) 209 B
'use strict'; function reject$(x, ft) { for (var i = 0, j = 0, I = x.length; i < I; i++) if (!ft(x[i], i, x)) x[j++] = x[i]; x.length = j; return x; } module.exports = reject$;