Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
doc: document the custom "inspect()" function behavior
Browse files Browse the repository at this point in the history
Closes #3361.
  • Loading branch information
TooTallNate committed Oct 5, 2012
1 parent fbb0ee6 commit f826b32
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions doc/api/util.markdown
Expand Up @@ -88,6 +88,19 @@ Example of inspecting all properties of the `util` object:

console.log(util.inspect(util, true, null));

Objects also may define their own `inspect(depth)` function which `util.inspect()`
will invoke and use the result of when inspecting the object:

var util = require('util');

var obj = { name: 'nate' };
obj.inspect = function(depth) {
return '{' + this.name + '}';
};

util.inspect(obj);
// "{nate}"


## util.isArray(object)

Expand Down

0 comments on commit f826b32

Please sign in to comment.