syntax 语法
遍历对象
var test = { //var a = 1; 对象里这样写是错的 a:1,b:2,c: function (){ alert("c"); } } for (var p in test){ if(typeof(test[p]) == "function"){ test[p](); }else{ alert(test[p]); } }
syntax 语法
遍历对象
var test = { //var a = 1; 对象里这样写是错的 a:1,b:2,c: function (){ alert("c"); } } for (var p in test){ if(typeof(test[p]) == "function"){ test[p](); }else{ alert(test[p]); } }