关于一本书里面的js源码的问题。
大家好!
最近看了将webgl的书,里面有些代码看着比较晕。想请教各位前辈赐教!
下面这行代码:
Sim.App.prototype = new Sim.Publisher;
是不是应该写成
Sim.App.prototype = new Sim.Publisher();
比较好?
下面这两个方法内容不同,名字和形参相同,是不是写错了?
Sim.Object.prototype.update = function()
{
this.updateChildren();
}
Sim.Object.prototype.update = function()
{
var i, len;
len = this.children.length;
for (i = 0; i < len; i++)
{
this.children[i].update();
}
}