Example java script code to remove a property from a JavaScript object.

let myObject = {
  "name": "Seo",
  "address": "usa",
  "code": "12345"
};

// method1
delete myObject.address;

// method2
delete myObject['address'];

// method2
let prop = "address";
delete myObject[prop];

Similar Posts