underscore.slice
v1.2.9
Published
🔨 Plugin for Underscore.js: add `_.slice()`, which slice array to deep-levels array
Maintainers
Readme
underscore.slice
🔨 Plugin for Underscore.js: add _.slice(), which slice array to deep-levels array
.__ .__
_____| | |__| ____ ____
/ ___/ | | |/ ___\/ __ \
\___ \| |_| \ \__\ ___/
/____ >____/__|\___ >___ >
\/ \/ \/Usage
Installation:
npm install underscore.slicevar _ = 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
