/ Published in: ActionScript 3

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function print_r(theObj,indent=""):String { var output=""; if (indent == "") { indent = " "; } else { indent += " "; } var type = (theObj.constructor == Array) ? "Array" : "Object"; output += "("+type+")=>\n"; if(theObj.constructor == Array || theObj.constructor == Object) { for(var p in theObj){ if(theObj[p].constructor == Array|| theObj[p].constructor == Object){ output += indent+"["+p+"]"; output += print_r(theObj[p],indent); } else { output += indent+"["+p+"]:"+theObj[p]+"\n"; } } } return output; }
Comments
