syntax syntax
iterate over objects
var test = { //var a = 1; this is wrong in the object 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 syntax
iterate over objects
var test = { //var a = 1; this is wrong in the object a:1,b:2,c: function (){ alert("c"); } } for (var p in test){ if(typeof(test[p]) == "function"){ test[p](); }else{ alert(test[p]); } }