2012年4月23日
摘要: <script type="text/javascript"> <!-- function SpecialArray(arr){ this.arr=arr; } SpecialArray.prototype.map=function(func){ for(var i=0;i<=this.arr.length;i++){ // for(var i=0,len=this.arr.length;i<len;i++){ this.arr[i]=func(this.arr[i]); } re... 阅读全文
posted @ 2012-04-23 09:56 逍遥叹 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 私有成员 <script type="text/javascript"> <!-- function CurrentAnswer(num) { var current=num; var newObject={ getCurrent:function(){return 'The current answer is :'+current;} } return newObject } var curr=new CurrentAnswer('5'); alert(curr.getCurrent()); //--> </s 阅读全文
posted @ 2012-04-23 09:02 逍遥叹 阅读(125) 评论(0) 推荐(0) 编辑