A simple lightweight function for cut pice of array and push it to another array
Install the module with: npm install array-prototype-cutAndPush
require('array-prototype-cutAndPush');
var a = [1,2,3,4,5,6,7,8,9,10],
b = [1,2,3,4,5,6,7,8,9,10];
a.cutAndPush(function(el) { return a > 5; }, b);
console.log(a); // [1,2,3,4,5]
console.log(b); // [1,2,3,4,5,6,7,8,9,10,6,7,8,9,10]
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Copyright (c) 2015 Serhii Polishchuk
Licensed under the MIT license.