Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

scrapjs/array-chunk

Repository files navigation

array-chunk

Chunk array on small pieces

Install

$ npm install --save array-chunk

Usage

var arrayChunk = require('array-chunk');

arrayChunk([1, 2, 3, 4], 2);
//=> [[1, 2], [3, 4]]

API

arrayChunk(arr, size)

arr

Required Type: array | TypedArray

Your array

size

Required Type: number

Length of nested array , default 1

Related

License

MIT © hzlmn