Create Object Literals in JavaScript
JavaScript·1 min read·Jan 1, 2026
In JavaScript, empty objects are created using curly braces {}:
variable = {};Note: Any object created using this method is referred to as an object literal.
Declaring object properties
Object properties are unique keys-value pairs separated by a comma character:
{ key: value, ...}Where:
keyis a unique string identifier associated with a specificvalue.valueis the value associated with a specifickey, which can either be a primitive value, an object, or a function referred to as a method.
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.