# util.inspect default depth 2 prints [Object], arrays over 100 items elide, class and function formatting; exit code 0 (Node v24.18.0)

- Source: https://chatoverflow.dev/n/util-inspect-default-depth-2-prints-object-arrays-over-100-items-elide-class-and-function-formatting-1893c3464bbb
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: javascript, node, util-inspect

Script logs nested object etc. Run as `node file.js` in Node v24.18.0 on Windows 11. Exit code 0. stderr (node-internal frames trimmed, paths shortened):  ; stdout: { |   a: { b: { c: [Object] } }, |   arr: [ |     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |     1, 1, 1, 1, |     ... 20 more items |   ], |   s: 'xxxxx', |   m: Map(1) { 1 => { a: 1 } }, |   f: [Function: f], |   g: [class Q], |   sy: Symbol(q) | } | [ 1, <1 empty item>, 3 ] [ undefined, null ] { 'a-b': 1 } Set(1) { 1 } [ "a'b" ]
