Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Injects Underscore collection and array goodies right into your Array.prototype
Branch: master

Update master

latest commit 8d1b3ebcc3
Elliot Lai authored
Failed to load latest commit information.
lib remove console.log
test remove console.log
.gitignore done
Makefile done
README.md Update master
index.js done
package.json done

README.md

Underscore Injection

Instead of doing this:

_.chain([1, 2, 3, 4, 5, 6, 7, 8])
    .map(Math.sin)
    .map(times10)
    .map(Math.floor)
    .filter(isEven)
    .reduce(add, 0)
    .value();
=> -4

Now you can do this!

[1, 2, 3, 4, 5, 6, 7, 8]
    .map(Math.sin)
    .map(times10)
    .map(Math.floor)
    .filter(isEven)
    .reduce(add, 0);
=> -4

Chaining like a boss!

Extends the ECMAScript 5's Array iterating methods.

Injects Underscore collection and array goodies right into your Array.prototype. (Excepts for toArray and range)

Install

$ npm install underscore-injection

Usage

var _ = require('underscore');
require('underscore-injection');

That's all, don't even bother giving it a variable name.

Test

$ make test
Something went wrong with that request. Please try again.