摘要:
我们知道C#里有继承,类也有扩展方法,而在JS世界有是否也有相似的概念和功能实现呢,答案是肯定的,现在我来和大家一起聊聊这方面的知识吧!:P <script type="text/javascript"> // 注意,prototype只对本script段起作用 // prototype原型关键字,为一个JS原对象扩展一个方法 Array.prototype.max = function() { var i, min = this[0]; for (i = 1; i < this.length; i++) { if (min > this[i]) m 阅读全文
posted @ 2011-06-03 12:02
张占岭
阅读(7905)
评论(0)
推荐(1)
浙公网安备 33010602011771号