Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function print(obj) {
- var identation = "";
- (function printFunction(obj) {
- if (typeof obj != "object") {
- console.log(identation + obj);
- }
- for (var property in obj) {
- if (obj.hasOwnProperty(property)) {
- console.log(identation + property + ":");
- identation += "--";
- printFunction(obj[property]);
- identation = identation.substr(0, identation.length - 2);
- }
- }
- })(obj);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement