【发布时间】:2010-12-23 15:05:27
【问题描述】:
函数 hex(x,y,side,isLast,color)
{//十六进制对象构造函数。
这个.x = x;
这个.y = y;
this.side = 边;
this.isLast = isLast;
this.color = 颜色;
函数乘法()
{
返回 this.x * this.y;
}
this.multiply = 相乘;
}
var hexagon = new hex(22,22,20,0,1);
document.write(hexagon.multiply);
加载 index.htm 时,在屏幕上写入函数而不是返回值的结果:
function multiply() { return this.x * this.y; }
:(
【问题讨论】:
标签: javascript