The difference between .splice() and .slice

.slice()

  • extracts a part of the array and returns the selected elements in a new array.
  • takes in two arguments. First argument is the start and second argument is the end but does not include the given end argument.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store