Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Teachable.

Objects – JavaScript


In JavaScript, objects are written using curly braces:

const myObject = {
  name: 'Simple Dev',
  description: 'A site designed to teach coding',
  age: 1,
  active: true


In JavaScript, you can store multiple values and give each value a name using an object. These names are called properties. Objects allows you to refer back to the value using the property name instead of a number (like with an array).

To access an object’s properties, use the following syntax:


Here are some examples of this syntax:


// Assign new value to property
myObject.description = 'New value';

You can also use square brackets to access and change property values. The property name must be in quotes inside the square brackets.

myObject['propertyName'] = 'New value';



Try the following statements in the console:

const myObject = {
  name: "Simple Dev",
  description: "A site designed to teach coding",
  age: 1,
  active: true
} = "John Smith"


Object literals on MDN

Back to: JavaScript Reference > JS Data Types