array-exclude

Copy an array without the first n and last n indexes

array-exclude

Copy an array without the first n and last n indexes

 
var exclude = require('array-exclude')
  , arr = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
;
 
var newArr = exclude(arr, 2, 3);
// [ 3, 4, 5, 6, 7 ] 
 
newArr === exclude;
// false 
 
$ npm install array-exclude

none

  • fromStart - the number of indexes to exclude from the start of the array (default: 0)
  • fromEnd - the number of indexes to exclude from the end of the array (default: 0)