SHARE
TWEET

Untitled

a guest May 13th, 2014 168 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function print(obj) {
  2.     var identation = "";
  3.  
  4.     (function printFunction(obj) {
  5.         if (typeof obj != "object") {
  6.             console.log(identation + obj);
  7.         }
  8.  
  9.         for (var property in obj) {
  10.             if (obj.hasOwnProperty(property)) {
  11.                 console.log(identation + property + ":");
  12.                 identation += "--";
  13.                 printFunction(obj[property]);
  14.                 identation = identation.substr(0, identation.length - 2);
  15.             }
  16.         }
  17.     })(obj);
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top