讲解一下 JavaScript对象的几种创建方式 ?
                                             参考答案:
                                         
                                        在JavaScript中,我们可以使用多种方式创建对象。以下是一些常见的方法:
- 对象字面量:这是创建对象的最简单方式。只需使用大括号 
{},然后在其中添加属性和方法。 
var obj = {
  name: "John",
  age: 30,
  sayHello: function() {
    console.log("Hello, my name is " + this.name);
  }
};
- 构造函数:你可以定义一个构造函数,然后使用 
new关键字来创建对象。构造函数本质上是一个返回对象的函数。 
function Person(name, age) {
  this.name = name;
  this.age = age;
  this.sayHello = function() {
    console.log("Hello, my name is " + this.name);
  }
}
var john = new Person("John", 30);
- Object.create():
Object.create()方法创建一个新对象,使用现有的对象作为新创建的对象的__proto__。 
var person = {
  isHuman: false,
  printIntroduction: function() {
    console.log(`My name is ${this.name}. Am I human? ${this.isHuman}`);
  }
};
var me = Object.create(person);
me.name = 'Matthew'; 
me.isHuman = true; 
me.printIntroduction();
- 类(ES6):ES6引入了类的概念,它是对基于原型的对象创建模式的语法糖。
 
class Person {
  constructor(name, age) {
    this.name = name;
    this.age = age;
  }
  sayHello() {
    console.log("Hello, my name is " + this.name);
  }
}
var john = new Person("John", 30);
以上就是JavaScript中常见的几种创建对象的方式。每种方式都有其适用的场景和优点,你可以根据具体的需求选择最适合的方式。