how do you create a new object in java script?
Answers
Answered by
3
Answer:
Explanation:
Different ways of creating an Object in javascript
Using the Object() constructor: var d = new Object(); ...
Using Object.create() method: var a = Object.create(null); ...
Using the bracket's syntactig sugar: var b = {}; ...
Using a function constructor. var Obj = function(name) { this. ...
Using the function constructor + prototype: ...
Using ES6 class syntax: ...
Singleton pattern:
Answered by
0
syntax:
<classname><objectname>=new<objectname>();
Similar questions