Nodejs Utililty Methods Array Inspect

List of utility methods to do Array Inspect

Description

The list of methods to do Array Inspect are organized into topic(s).

Method

inspect()
Array.prototype.inspect = function() {
  return '[' + this.map(Object.inspect).join(', ') + ']';
};
inspect(depth)
var util = require("util");
Array.prototype.inspect = function(depth) {
  var str = '[', i;
  for(i=0; i<this.length && str.length < 240; i++) {
    str += util.inspect(this[i], {colors: true,depth: depth-1}) + (i<this.length-1? ', ': '');
  return str + (this.length>i? '+' + (this.length-i): '') + ']';
};