delete will delete the object property, but will not reindex the array or update its length. This makes it appears as if it is
myArray.splice(start, deleteCount) actually removes the element, reindexes the array, and changes its length.
> myArray = ['a', 'b', 'c', 'd']
John Resig, creator of jQuery created a very handy Array.remove method that I always use it in my projects.
// Array Remove - By John Resig (MIT Licensed)
and here’s some examples of how it could be used:
// Remove the second item from the array
- MDN Array.splice
- What is the difference between using the delete operator on the array element as opposed to using the Array.splice method?