js 疑难01 new()

180 阅读1分钟

js中的new()到底做了些什么?

要创建Person 的新实例,必须使用new 操作符。以这种方式调用构造函数(new ClassA())实际上会经历以下4个步骤:

  • 构造函数