Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

delete method

//Warning !
//Array elements can be deleted using the JavaScript operator delete.
//Using delete leaves undefined holes in the array.
//Use pop() or shift() instead

const fruits = ["Banana", "Orange", "Apple", "Mango"];
delete fruits[0];Warning !
// >> ["undefined", "Orange", "Apple", "Mango"];

  //if you find this answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)
 
PREVIOUS NEXT
Tagged: #delete #method
ADD COMMENT
Topic
Name
9+3 =