摘要:
<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... 阅读全文
摘要:
私有成员 <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 阅读全文