Creating Object in Javascript
Using Object literal
Using Function Constructor
Using
Object.create
Object.create
creates a new object with its prototype object passed as a parameter (obj2 in above example).Using curly brackets syntax
In ES6, we use class pattern
Last updated