JavaScript Documentvar sys=function () {}sys._print_r=function ($v, $left, $ret) {if (typeof $left = = = ' undefined ') {$ left =-1;} if (typeof $ret = = = ' undefined ') {$ret = "My";} $left +=1;if (typeof $v = = = ' object ') {return sys.arraytostring ($v, $left, $ret);} return $ret + $v + "\ n"; }sys.arraytostring=function ($v, $left, $ret) {$ret + = "array\n" +str_repeat (", $left) +" (\ n "; for ($key in $v) {$parmret = $ret +str_repeat (", $left *4+2) +" ["+ $key +"] = "; $ret =sys.recursionprintr ($v [$key], $left, $parmret);} $ret +=str_repeat (", $left) +") \ n \ nthe "; return $ret;} Recursive call _print_rsys.recursionprintr=function ($val, $left, $ret) {if (typeof $val = = = ' object ') {return Sys._print_r ($val, $left, $ret);} return $ret + ' <div style= ' border:1px #eee solid; width:auto;padding:5px; ' + ' Left: ' + ($left *50+100) + ' px;position:relative; height:20px; Overflow-y:hidden; "' + ' onclick=" ' + ' "><span onclick=" window. SYS.ch.apply (this.parentnode,[1]) ">[+]</span><span onclick=" window. SYS.ch.apply (This.parentnode,[-1]) "> [-]</span> ' + $val + ' </div>\n '; }sys.print_r=function ($v, $left, $ret) {if (typeof $left = = = ' undefined ') {$left =-1;} if (typeof $ret = = = ' undefined ') {$ret = "My";} Return ' <pre> ' +sys._print_r ($v, $left, $ret) + ' </pre> ';} Sys.ch=function (sign) {var h=this.style.height;h= (h.replace (/px/, ')); this.style.height= (parseint (h) +sign*100) + ' PX '} function str_repeat ($str, $num, $CN) {if (typeof $cn = = = "undefined") {$CN = 0;} $CN = $CN +1; if ($num ==0) {return "";} else {$temp = $str;} return $num > $CN? $temp +str_repeat ($str, $num, $CN): $temp;}
Note: The array here is not an object. If you want to output an array, change the judging type to array
Call: The three here refers to the object in the Three.js
Sys.print_r (three)
JS realizes Pring_r function