How to remove a property from a JSON object?

Fuji Nguyen
Knowledge Pills
Published in
2 min readDec 16, 2022

--

To remove a property from a JSON object in JavaScript, you can use the delete operator.

Here is an example of how to use the delete operator to remove the property age from a JSON object:

let obj = {
name: "John",
age: 30,
occupation: "developer"
};

delete obj.age;

console.log(obj); // Output: { name: "John", occupation: "developer" }

--

--

Fuji Nguyen
Knowledge Pills

DX Advocate, OpenSource Contributor, Pickleball Player - Improves software dev experience, contributes to opensource projects, and plays pickleball for leisure.