var obj = {};
obj.a = 12;
obj.funa = function(){
console.log(111);
}
console.log(obj[‘a‘]);
obj[‘funa‘]();
for(var i in obj){
console.log(obj[i]);
}
结果:
14
12
17
function (){
console.log(111);
}
时间: 2024-10-22 01:54:17
var obj = {};
obj.a = 12;
obj.funa = function(){
console.log(111);
}
console.log(obj[‘a‘]);
obj[‘funa‘]();
for(var i in obj){
console.log(obj[i]);
}
结果:
14
12
17
function (){
console.log(111);
}