Home

Awesome

underscore.slice

node version npm version downloads count size license github-ci

🔨 Plugin for Underscore.js: slice array to deep-levels array

<pre> .__ .__ _____| | |__| ____ ____ / ___/ | | |/ ___\/ __ \ \___ \| |_| \ \__\ ___/ /____ >____/__|\___ >___ > \/ \/ \/ </pre>

Install

npm install underscore.slice

Usage

var _ = require('underscore');
var slice = require('underscore.slice');
_.mixin({ slice: slice });

var list = [1, 2, 3, 4, 5];
_.slice(list, 2); // [[1, 2], [3, 4], [5]]
_.slice(list, 4); // [[1, 2, 3, 4], [5]]

License

The MIT License @ 2014