.find() - DarthJDG/Mangler.js GitHub Wiki
Returns a new mangler object with items that pass the test.
.find([test])| Parameter | Type | Default | Description |
|---|---|---|---|
| test | Test | {} |
The test expression to check against. |
Returns a new mangler object.
If called without a test parameter, all items will be copied to the new mangler object. List of results will be returned in a new mangler object for method chaining. Call the .end() method to return to the previous mangler object in the chain, or the .endAll() method to return the mangler object at the top of the chain.
For more information on test expressions, see Mangler.test().
m = Mangler([1, 2, 3, 4]);
m.find(); // Returns new mangler object with items [1, 2, 3, 4]
m.find({ $gt: 2 }); // Returns new mangler object with items [3, 4]