var asfman = {};
asfman.dict = {
"keys": function(obj){
var b = [];
for(var i in obj){
b.push(i);
}
return b;
},
"values": function(obj){
var b = [];
for(var i in obj){
b.push(obj[i]);
}
return b;
},
"items": function(obj){
var b = [];
for(var i in obj){
b.push([i, obj[i]]);
}
return b;
}
};
调用
alert(asfman.dict.items(要打印的对象).join("\n"));
网友评论