JSFiddle - React, Tailwind, and code Playground

HTML

<body>
  Get information about object structure.<br>
  Similar to <b>var_dump()</b> function in PHP.<br>
  <i>source: <a href="http://phpjs.org/functions/var_dump/">http://phpjs.org/functions/var_dump</a></i><br><br>
  
  <input type="button" value="var_dump(body)" id="dump_body" autofocus />
  <input type="button" value="var_dump(button)" id="dump_button" />
  <input type="button" value="var_dump(object)" id="dump_object" />
  
  <br><br>

  <div id="result"></div>

</body>
</html>

CSS

a{
    color:#373;
}

JavaScript

$(function(){
  
  function var_dump() {
    //  discuss at: http://phpjs.org/functions/var_dump/
    // original by: Brett Zamir (http://brett-zamir.me)
    // improved by: Zahlii
    // improved by: Brett Zamir (http://brett-zamir.me)
    //  depends on: echo
    //        note: For returning a string, use var_export() with the second argument set to true
    //        test: skip
    //   example 1: var_dump(1);
    //   returns 1: 'int(1)'

    var output = '',
      pad_char = ' ',
      pad_val = 4,
      lgth = 0,
      i = 0;

    var _getFuncName = function(fn) {
      var name = (/\W*function\s+([\w\$]+)\s*\(/)
        .exec(fn);
      if (!name) {
        return '(Anonymous)';
      }
      return name[1];
    };

    var _repeat_char = function(len, pad_char) {
      var str = '';
      for (var i = 0; i < len; i++) {
        str += pad_char;
      }
      return str;
    };
    var _getInnerVal = function(val, thick_pad) {
      var ret = '';
      if (val === null) {
        ret = 'NULL';
      } else if (typeof val === 'boolean') {
        ret = 'bool(' + val + ')';
      } else if (typeof val === 'string') {
        ret = 'string(' + val.length + ') "' + val + '"';
      } else if (typeof val === 'number') {
        if (parseFloat(val) == parseInt(val, 10)) {
          ret = 'int(' + val + ')';
        } else {
          ret = 'float(' + val + ')';
        }
      }
      // The remaining are not PHP behavior because these values only exist in this exact form in JavaScript
      else if (typeof val === 'undefined') {
        ret = 'undefined';
      } else if (typeof val === 'function') {
        var funcLines = val.toString()
          .split('\n');
        ret = '';
        for (var i = 0, fll = funcLines.length; i < fll; i++) {
          ret += (i !== 0 ? '\n' + thick_pad : '') + funcLines[i];
        }
      } else if (val instanceof Date) {
        ret = 'Date(' + val + ')';
      } else if (val instanceof RegExp) {
        ret = 'RegExp(' +...