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);

Unlock the program 🚀

Pay once, own it forever.

€79

30-day money-back guarantee

  • 13 modules
  • 113 lessons with full-code examples
  • 29 projects with commented solutions
  • All future lesson and project updates
  • Lifetime access

By submitting this form, you agree to the Terms & Conditions and Privacy Policy.