how to delete attribute with certain value from object javascript code example
Example 1: javscript remove a property
var myObject = {
"name": "jon",
"gender": "male",
"registered": "yes"
};
delete myObject.gender;
console.log(myObject);
delete myObject.gender;
delete myObject['gender'];
var prop = "gender";
delete myObject[prop];
Example 2: Delete Properties from a JavaScript Object
var ourDog = {
"name": "Camper",
"legs": 4,
"tails": 1,
"friends": ["everything!"],
"bark": "bow-wow"
};
delete ourDog.bark;