can you please tell me how to how to delete value from array using jquery ?.I am able to delete values But in place of value I am getting undefined value.
items = ['a', 'b', 'c', 'd'];
if(items.indexOf('c') !== -1) {
delete items[items.indexOf('c')];
}
console.log(items)
alert(items)
alert(items.length)
It is printing 4 length.It is taking undefined value in array.How to remove completely from array ? So that it length become 3.and out put become a,b,d