DEV Community

Discussion on: The trick to making console.log play nice with complex objects

Collapse
jeremybradbury profile image
Jeremy Bradbury

I'm with Peter on console.dir & TJ prettifying JSON can cause other problems.

The depth to null, is not great, but perhaps 5... You shouldn't rly allow infinite depth.

And ideally just log obj.a.b instead or use console log how it was intended: console.log('label for line', obj.a, obj.a.b, obj.a.b.c, obj.a.b.c.d)