distribute-array
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"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 ], | ||
// [], [], [], [], [] ] | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8096
14