1 //对象字面量 { } 2 var dict = { 'zs': '张三', age: 18, email: 'jk@itcast.cn', gender: '男', sayHi: function () { 3 4 } }; 5 for (var key in dict) { 6 alert(key + ' ' + dict[key]); 7 }
1 //对象字面量 { } 2 var dict = { 'zs': '张三', age: 18, email: 'jk@itcast.cn', gender: '男', sayHi: function () { 3 4 } }; 5 for (var key in dict) { 6 alert(key + ' ' + dict[key]); 7 }