new object remove one property from object javascript code example
Example 1: javascript remove property from object
var person = {"first_name": "Billy","last_name": "Johnson"};
delete person.last_name; //delete last_name property
Example 2: implement the remove property function
function removeProperty(obj, prop) {
if (obj.hasOwnProperty(prop)) {
delete obj[prop];
return true;
}
return false;
}