Returns an array that contains the element specified by the first argument & all subsequent elements up to, but not including, the element specified by the second argument.
Doesn’t modify the array on which it is invoked.
Deletes, inserts or does both operations at the same time.
Modifies the array on which it is invoked.
Returns an empty array if no elements were deleted.
The first argument specifies the position in the array where the insertion and/or deletion is to begin. The second argument specifies the number of elements that should be deleted from the array.
If the second argument is omitted, all elements starting from the start element to the end of the array are deleted.
The first two arguments may be followed by any number of additional arguments that specify elements to be inserted into the array, starting at the position specified by the first argument.
lettech= ["html", "css", "JavaScript", "python"]// the 3rd argument will be inserted into the arrayletsubTech=tech.splice(3, 1, "React")console.log(tech) // => ['html', 'css', 'JavaScript', 'React];console.log(subTech) // => ['python'];