Javascript “Not a Constructor” Exception while creating objects

后端 未结 14 1214
[愿得一人]
[愿得一人] 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 19:00

    I've googled around also and found this solution:

    You have a variable Project somewhere that is not a function. Then the new operator will complain about it. Try console.log(Project) at the place where you would have used it as a construcotr, and you will find it.

提交回复
热议问题