.filter() - DarthJDG/Mangler.js GitHub Wiki

Removes all items that do not pass the test.

.filter(test)
Parameter Type Default Description
test Test {} The test expression to check against.

Returns

Returns the mangler object itself for chaining.


Removes all items from the .items[ ] array that do not pass the test. For more information on test expressions, see Mangler.test().

Example

m = Mangler([1, 2, 3, 4]);

m.filter({ $gt: 2 });    // m.items = [3, 4]
⚠️ **GitHub.com Fallback** ⚠️