getList访问不到对象里面的arr table
var mod,b=0;
(function test(a){
"use strict";
a = a||{}; var arr=[],count= 0,table={};
a.set=function(key,value,callback){
arr.push(value);
table[key]=value;
count+=value; if(callback)callback();
};
a.urlParse=function(url){ if(!(url.indexOf("?")>=0))return; var str=url.split("?")[1].split(/&|=/),result={};
for(var i= 0,len=str.length;i<len;i+=2){
table[str[i]]=str[i+1]-0;
result[str[i]]=str[i+1]-0;
count+=table[str[i]];
} return result;
}
a.get=function(key){ return table[key]?table[key]:"Don't has the value of"+key;
}
a.count=function(){ return count;
}
b=a;})(mod);
b.getList=function(){
var arrTable=[]; for(var i= 0,len=arr.length;i<len;i++){
arrTable.push(arr[i]);
} for(var key in table){
arrTable.push(key);
} return arrTable;}
桃花长相依
相关分类