sequence

Read the next two articles for slice() and splice() if you don’t already know

For an explanation of slice, see juejin.cn/post/688376…

For an explanation of Splice, see juejin.cn/post/688339…

Similarities between slice() and splice(

Slice () and splice() are both methods defined by the Array prototype.

Difference between slice and splice

The return value

  • Slice () returns a new array
  • Splice () has no return value. The return value is undefined

The original array

  • Slice () does not alter the original array
  • Splice () changes the array

If you have any questions or unclear descriptions, please leave a comment and give a thumbs up if this article helps you.