Skip to content

Instantly share code, notes, and snippets.

@cheng470
Last active August 29, 2015 14:07
Show Gist options
  • Save cheng470/467b42ea87865b0ed2d7 to your computer and use it in GitHub Desktop.
Save cheng470/467b42ea87865b0ed2d7 to your computer and use it in GitHub Desktop.
var getObjInfo = function(obj) {
var s = "", so = "", sf = "";
for (var k in obj) {
var t = typeof obj[k];
if (t === "object") {
so += k + ": " + obj[k] + "\n";
} else if (t === "function") {
sf += k + ": " + obj[k] + "\n";
} else {
s += k + ": " + obj[k] + "(" + t + ")\n";
}
}
return s + "\nobj:\n" + so + "\nfunc:\n" + sf;
};
console.info(location);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment