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

Returns an array of objects that pass the test.

Mangler.find(collection[, test])
Parameter Type Default Description
collection Iterable The collection of values to search.
test Test {} The test expression to check against.

Returns

Returns an array of items that pass the test.


If called without a test parameter, it returns all items from the collection.

The collection iterable could be an object, array or mangler object by default. Please note that even though a JavaScript object is iterable, it is not guaranteed that its properties will be evaluated in any particular order.

For more information on test expressions, see Mangler.test().

Example

a = [1, 2, 3, 4];

Mangler.find(a);                // Returns [1, 2, 3, 4]
Mangler.find(a, { $gt: 2 });    // Returns [3, 4]
⚠️ **GitHub.com Fallback** ⚠️