Object Literal

noun

say it: “OB-jekt LIT-er-ul” /ˈɒbdʒɛkt ˈlɪtərəl/

JavaScript's curly-brace way of creating an object by listing its properties, like { name: "Chai", price: 18 }.

What is Object Literal in JavaScript?

Object Literal — Brace syntax that creates an object from a list of properties.

const order = {
    item: "tea",
    quantity: 2
};

In a sentence

  • “I made the product with an object literal: { name: "Chai", price: 18 }.”

Level: Apprentice · More JavaScript terms at this level

Updated