摘要:
prototype 属性返回对象类型原型的引用。objectName.prototypeobjectName 参数是对象的名称。说明用 prototype 属性提供对象的类的一组基本功能。 对象的新实例“继承”赋予该对象原型的操作。例如,要为 Array 对象添加返回数组中最大元素值的方法。 要完成这一点,声明该函数,将它加入 Array.prototype, 并使用它。function array_max( ){ var i, max = this[0]; for (i = 1; i < this.length; i++) { if (max < this[i]) max = t 阅读全文
posted @ 2011-07-30 19:54
左正
阅读(176)
评论(0)
推荐(0)

浙公网安备 33010602011771号