What is the difference between using the delete operator on the array element as opposed to using the Array.splice method?
For example:
myArray = [\
delete: delete will delete the object property, but will not reindex the array or update its length. This makes it appears as if it is undefined:
splice: actually removes the element, reindexes the array, and changes its length.
Delete element from last
arrName.pop();
Delete element from first
arrName.shift();
Delete from middle
arrName.splice(starting index,number of element you wnt to delete);
Ex: arrName.splice(1,1);
Delete one element from last
arrName.splice(-1);
Delete by using array index number
delete arrName[1];