JSPM

@extra-array/chunk

2.6.53
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 135
  • Score
    100M100P100Q74632F
  • License MIT

Breaks array into chunks of given size.

Package Exports

  • @extra-array/chunk

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@extra-array/chunk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Breaks array into chunks of given size. 🏃 📼 📦 🌔

This is part of package extra-array.

array.chunk(x, [n]);
// x: an array
// n: chunk size (1)
// --> chunks
const array = require('extra-array');

var x = [1, 2, 3, 4, 5];
array.chunk(x, 2);
// [ [ 1, 2 ], [ 3, 4 ], [ 5 ] ]

array.chunk(x, 3);
// [ [ 1, 2, 3 ], [ 4, 5 ] ]

references