There are 3 ways to create an object in JavaScript.
Let's see a simple code to create an object using object literal.
emp={id:102,name:"Rahul Kumar",salary:50000}
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