Javascript “Not a Constructor” Exception while creating objects

后端 未结 14 1249
[愿得一人]
[愿得一人] 2020-11-27 18:15

I am defining an object like this:

function Project(Attributes, ProjectWidth, ProjectHeight)
{
    this.ProjectHeight = ProjectHeight;
    this.ProjectWidth          


        
14条回答
  •  感动是毒
    2020-11-27 18:44

    To add to @wprl's answer, the ES6 object method shorthand, like the arrow functions, cannot be used as a constructor either.

提交回复
热议问题