underscore-unchained

Enhance arrays and other objects with Underscore methods so you don't need to mess with _.chain() and .value() every time you do two Underscore methods in sequence.


Keywords
underscore, syntactic, sugar, reckless, prometheus, titans, olympus, shelley, convenience, chain, unchain
License
MIT
Install
bower install underscore-unchained

Documentation

underscore-unchained

sigfried.github.io/underscore-unchained/

_.unchain(obj, magicPowers)

A mixin that lets you use Underscore methods directly from objects or classes of objects, and there's no need for _.chain()

_.unchain(['a','bb','ccc'])
    .pluck('length')
    .last()
    .range()
=> [0, 1, 2]

_.prometheus(obj, magicPowers)

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.

_.prometheus(Array);
['a','bb','ccc'].pluck('length').last().range()
=> [0, 1, 2]