我正在定义一个这样的对象:
function Project(Attributes, ProjectWidth, ProjectHeight)
{
this.ProjectHeight = ProjectHeight;
this.ProjectWidth = ProjectWidth;
this.ProjectScale = this.GetProjectScale();
this.Attributes = Attributes;
this.currentLayout = '';
this.CreateLayoutArray = function()
{....}
}
Run Code Online (Sandbox Code Playgroud)
然后我尝试创建和实例像这样:
var newProj = new Project(a,b,c);
Run Code Online (Sandbox Code Playgroud)
但是这个例子被抛出:
Project is not a constructor
Run Code Online (Sandbox Code Playgroud)
可能有什么不对?我搜索了很多,但仍然无法弄清楚我做错了什么.