1.生成对象的方法

1.利用对象构造函数

            const obj = new Object();

2.字面量写法

            const obj = {
                
            }

2.属性的增强写法

1.ES5

            const name = 'sunny',
                   age = 18,
                   sex = 'male';

            const obj = {
                name: name,
                age: age,
                sex: sex
            }
            console.log(obj);

2.ES5属性增强写法

            const name = 'sunny',
                   age = 18,
                   sex = 'male';

            const obj = {
                name,
                age,
                sex
            }
            console.log(obj);

3.函数增强写法

1.ES5

            const obj = {
                eat: function() {
                    console.log('eatting');
                },
                run: function() {
                    console.log('running');
                }
            }

2.ES6函数增强写法

            const obj = {
                eat() {
                    console.log('eatting');
                },
                run() {
                    console.log('running');
                }
            }