Skip to content
Advertisement

print_r() for many objects

For logging purposes, I am looking for something that behaves like print_r() (or similar), but accepts not only one object to be displayed, but many of them. Such as var_dump() is doing.

Desired:

JavaScript

Any suggestions?

Advertisement

Answer

Since no one is doing it… Self-answered question, based on @Peter Krebs comment:

Nesting the many objects within [ ] for converting it to a single array can just do the job:

JavaScript

Simple, smart.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement