Interview Questions

1. How to create objects in JavaScript?

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.

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

By Md Riyazuddin 2 0
Is this helpful? Yes No

Submit an interview question

Submitted questions and answers are subject to review and editing, and may or may not be selected for posting, at the sole discretion of w3Sniff.

Get Started

Comments

Leave a Comment


Check out more interview questions

Based on your skills

MS SQL Server

2567283 1720 50 859

Angular

67716 92 0 46

Wordpress

57018 72 1 36