Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

distribute-array

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

distribute-array - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "distribute-array",
"version": "0.0.1",
"version": "0.0.2",
"description": "Distributes one array evenly between a given number of smaller arrays",

@@ -5,0 +5,0 @@ "main": "./lib/distribute-array.js",

# distribute-array
Distributes one array evenly between a given number of smaller arrays
```javascript
var da = require('distributed-array');
var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
newArr = da(arr, 3); // newArr is now [ [ 1, 2, 3, 10 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ]
newArr = da(arr, 5); // newArr is now [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ], [ 7, 8 ], [ 9, 10 ] ]
newArr = da(arr, 15); // newArr is now [ [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 5 ],
// [ 6 ], [ 7 ], [ 8 ], [ 9 ], [ 10 ],
// [], [], [], [], [] ]
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc