JavaScript > Arrays

Slice vs Splice in JavaScript

What is the difference between splice and slice in an array in JavaScript?


Slice

Slice is an array method to manipulate the arrays. In arrays slice() method returns the selected elements in an array, as a new array object. It extracts the characters of an array and returns the extracted characters as an new array. It has two parameters 'Start' and 'End'. click on hyperlink to know more about Slice.

Splice

Splice is an array method, which is used to add/remove  the new elements to an array. Click on hyperlink to know more about Splice.  

 Views: 8171 | Post Order: 165



Write for us






Hosting Recommendations