This article will discuss how to remove a property from a JavaScript object.

Remove property from an object using the delete operator. #

To remove a property from a JavaScript object, we can use the JavaScript delete operator. The example is given below.

<script>

  let obj = {
    name:"Apu",
    age:20,
    country:"India"
   };

  delete obj.age;

  console.log(obj);
</script>

The delete operator deletes the property and its value also. The delete operator is used on an object. You can't use the operator on a variable.