three different ways to create objects in JavaScript:
- Object Literal Notation:
var obj = {
key1: value1,
key2: value2,
...
};
- Object Constructor Notation:
var obj = new Object();
obj.key1 = value1;
obj.key2 = value2;
...
- Using Object.create() Method:
var obj = Object.create(Object.prototype);
obj.key1 = value1;
obj.key2 = value2;
...