Utilizor
Contact Us

Object Literals

Creating objects with literal syntax.

Object Literals

This is the easiest way to create a JavaScript Object.

Using an object literal, you both define and create an object in one statement.

An object literal is a list of name:value pairs (like age:50) inside curly braces {}.

Example

const person = {firstName:"John", lastName:"Doe", age:50, eyeColor:"blue"};