JS Coding Questions Logo
JS Coding Questions
#255💼 Interview💻 Code

What is an object initializer

Advertisement

728x90

An object initializer is an expression that describes the initialization of an Object. The syntax for this expression is represented as a comma-delimited list of zero or more pairs of property names and associated values of an object, enclosed in curly braces ({}). This is also known as literal notation. It is one of the ways to create an object.

javascript
1var initObject = { a: "John", b: 50, c: {} };
2
3console.log(initObject.a); // John

Advertisement

Responsive Ad
🎯 Practice NowRelated Challenge

JavaScript Coding Exercise 84

Test your knowledge with this interactive coding challenge.

Start Coding

Advertisement

728x90
255of476