.last() - DarthJDG/Mangler.js GitHub Wiki
Returns the last item that passes the test.
.last([test])| Parameter | Type | Default | Description |
|---|---|---|---|
| test | Test | {} |
The test expression to check against. |
Returns the last item that passes the test.
If called without a test parameter, it returns the last item of the .items[ ] array. For more information on test expressions, see Mangler.test().
m = Mangler([1, 2, 3, 4]);
m.last(); // Returns 4
m.last({ $lt: 4 }); // Returns 3