Object creation

1. Create the object

var object = Object.create()
Copy the code

2. Object literals

var object = {}
Copy the code

3. Function constructor

function Person(name) {
    var object = {}    
    object.name = name
    return object
}
var object = new Person('Judy')
Copy the code

4. Function constructors with prototypes

function Person() {}
Person.prototype.name = 'Judy'
var object = new Person()
Copy the code