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}   

Related questions

0 votes
asked Mar 23, 2023 in Oracle by john ganales
+1 vote
asked Apr 5, 2020 in Docker by ryan harris
...