What is the difference between using the delete operator on the array element as opposed to using the Array.splice method?
For example:
myArray = [\
Easiest way is probably
var myArray = ['a', 'b', 'c', 'd']; delete myArray[1]; // ['a', undefined, 'c', 'd']. Then use lodash compact method to remove false, null, 0, "", undefined and NaN myArray = _.compact(myArray); ['a', 'c', 'd'];
Hope this helps. Reference: https://lodash.com/docs#compact