Skip to content

What is the purpose of the array slice method in JavaScript? #343

Answered by d4tdev
montasim asked this question in Q&A
Discussion options

You must be logged in to vote

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.

See details at: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by montasim
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants