All pastes #212307 Raw Edit

Untitled

public text v1 · immutable
#212307 ·published 2006-10-20 20:19 UTC
rendered paste body
function print_r(theObj){
        var result = '';
  if(theObj.constructor == Array || theObj.constructor == Object){
    for(var p in theObj){
      if(theObj[p].constructor == Array|| theObj[p].constructor == Object){
                result = result + "<li>["+p+"] => "+typeof(theObj)+"</li>";
                result = result + print_r(theObj[p]);
      } else {
                result = result + "<li>["+p+"] => "+theObj[p]+"</li>";
      }
    }
  }

        return result;

}