Google News
logo
JavaScript - Interview Questions
How to create objects in JavaScript ?
There are 3 ways to create object in JavaScript.

By object literal
By creating instance of Object
By Object Constructor

Let's see a simple code to create object using object literal.

Ex : emp={id:100,name:"Free Time Learn",salary:45000} 
Advertisement