function printObject(o) { var out = ''; for (var p in o) { out += ' ' + ':: ' + p + '(' + typeof(o[p]) + ') ::' + ' ' + o[p] + ' '; } console.log(out); }
来自: https://gist.github.com/okor/1536669