Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
24
rated 0 times [  26] [ 2]  / answers: 1 / hits: 101547  / 12 Years ago, sat, june 23, 2012, 12:00:00

In jQuery/JavaScript, How do I remove an array element?



something like:



array.remove(array[key]);

// or

array.remove(value)

More From » jquery

 Answers
107

Judging by your code, it sounds like you want to delete an object's property, which you would do with delete:



var obj = { key: value };

delete obj[key];


A very useful guide on working with objects in JavaScript can be found on MDN.


[#84713] Thursday, June 21, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anitadevonm

Total Points: 730
Total Questions: 93
Total Answers: 74

Location: Estonia
Member since Wed, Jun 8, 2022
2 Years ago
;