mahonglin123456 发表于 2017-4-12 06:06:00

javascript也玩php的var_dump查看变量内容

  function var_dump(o){var str = [];var pre = '';typeof o == 'function' && '';typeof o == 'string' ? alert(o) : alert(each.call(o));function each(o){for (var p in this) {typeof this == 'object' && (pre += '[' + p + '].', each.call(this)) || str.push(pre + '[' + p + ']->[' + this + '] /r/n')}return str.join('');}}
页: [1]
查看完整版本: javascript也玩php的var_dump查看变量内容