_.slice

Returns a shallow copy of a portion of an array into a new array object selected from begin to end (end not included)

  1. // Lodash
  2. var array = [1, 2, 3, 4]
  3. console.log(_.slice(array, 1, 3))
  4. // output: [2, 3]
  5.  
  6. // Native
  7. var array = [1, 2, 3, 4]
  8. console.log(array.slice(1, 3));
  9. // output: [2, 3]

Browser Support for Array.prototype.slice()

ChromeEdgeFirefoxIEOperaSafari
1.0 ✔1.0 ✔