There are many ways to create objects in javascript as mentioned below:
i. Object literal syntax:
The object literal syntax (or object initializer), is a comma-separated set of name-value pairs wrapped in curly braces.
var object = { name: "Sudheer", age: 34, }
1. What are the possible way to create objects in JavaScript
There are many ways to create objects in javascript as mentioned below:
i. Object literal syntax:
The object literal syntax (or object initializer), is a comma-separated set of name-value pairs wrapped in curly braces.
var object = { name: "Sudheer", age: 34, }