Underscore-unchained
sigfried.github.io/underscore-unchained/
_.unchain(obj, magicPowers) // obj now has all the power of Underscore and any other powers you choose to give it
A mixin that lets you use Underscore methods directly from objects or classes of objects, and there’s no need for _.chain()
1 2 3 4 5 |
|
Defy the gods and bring the full power of Underscore to all your Arrays, Objects, or whatever. Also works with constructors of user-defined classes. Use at your own risk.
1 2 3 4 5 6 7 |
|
['a','bb','ccc'].pluck('length').last().range() // OMG, my arrays can do anything!
=> [0, 1, 2]