Last active
August 29, 2015 14:07
-
-
Save cheng470/467b42ea87865b0ed2d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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