0 votes
in JavaScript by
How to create objects in JavaScript?

1 Answer

0 votes
by

There are 3 ways to create an object in JavaScript.

  1. By object literal
  2. By creating an instance of Object
  3. By Object Constructor

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

  1. emp={id:102,name:"Rahul Kumar",salary:50000}   
...