I have object with bad indexes. I can’t edit this, because i application this working ok.
var object = { "aaa": 1, "aaa": 2, "aaa" : 3, "aaa" : 4};
$.each(object, function(key, value){
});
how can i remove all values where value = 2 and 4?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t. Every value overwrites the previous one in the literal.
You will have to ensure that the object literal is well-formed, then use something like this (ES5) :