How to Create Objects in JavaScript?
In this example, we've created three different objects using object literals, constructor functions, and the ES6 class syntax. We've also added comments to explain what each section of the code is doing, which can make it easier for other developers (or yourself in the future) to understand the code. Finally, we've outputted the object properties to the console so that we can see the results of the code in action.
coded by Anshul Soni
see my website now: https://anshulsoni.tech
object in js
The object data type is used to represent a collection of key-value pairs. An object can be created using the curly braces {} syntax or the new Object() syntax. For example: