Nodejs Array Inspect inspect(depth)

Here you can find the source of inspect(depth)

Method Source Code

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? ', ': '');
   }/*from  w w  w  .j  ava2 s  .c o  m*/
   
   return str + (this.length>i? '+' + (this.length-i): '') + ']';
};

Related

  1. inspect()
    Array.prototype.inspect = function() {
      return '[' + this.map(Object.inspect).join(', ') + ']';
    };