Skip to content

Instantly share code, notes, and snippets.

@MauricioRobayo
Last active June 7, 2021 19:49
Show Gist options
  • Select an option

  • Save MauricioRobayo/e760a42c9f55ee493a608bf9073d3718 to your computer and use it in GitHub Desktop.

Select an option

Save MauricioRobayo/e760a42c9f55ee493a608bf9073d3718 to your computer and use it in GitHub Desktop.
slice.js #gogofast
The slice() method returns a shallow copy of a portion of an array into a new array object selected from start to end (end not included) where start and end represent the index of items in that array. The original array will not be modified.
slice()
slice(start)
slice(start, end)
The splice() method changes the contents of an array by removing or replacing existing elements and/or adding new elements in place.
splice(start)
splice(start, deleteCount)
splice(start, deleteCount, item1)
splice(start, deleteCount, item1, item2, itemN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment