function Person() {
  if (!new.target) {
    throw new TypeError('Error');
  }
}
  console.log(new Person());

new.target属性,该属性一般用在构造函数之中,返回 new 命令作用于的那个构造函数。如果构造函数不是通过 new 命令或 Reflect.construct()调用的,new.target 会返回 undefined,因此这个属性可以用来确定构造函数是怎么调用的