Update & Delete Object Properties in JavaScript

JavaScript·1 min read·Jan 1, 2026

Update object properties

To add an additional property to an object after its creation or update an existing one, you can use the dot syntax as follows:

object.key = value;

Or the square brackets syntax as follows:

object["property"] = value;

Example

Let's consider this script:

create_user.js
let user = {  firstName: "John"};user.lastName = "Doe";user["email"] = "jdoe@mail.com";console.log(user);