var foo; function output(foo){ console.log(foo); }; var bar = {name: "baz", email: "fiz@example.com", sendmail: function() { } }; for (foo in bar) { output(foo); };