To preface this post, I do know that there have been similar threads to this in the past, but I could not find one that was more recent than early 2016. The feature explained below is standard in every similar loosely-typed language that I've dealt with. Lua is the only one I've worked with that lacks it.
I've been happy with Lua's print() options for a long time...
...And then I began using HTTP calls that return JSON in my projects. I've noticed for a long time that trying to call print() on a table is a very unfortunate process, but hey! I should always know what kind of layout my table has, right? I made it after all.
Well, with JSON I’ve realized just how much that’s not true. Right now, it is extremely hard to debug any errors that I run into with data stored in a table.
What’s needed is a recursive print() that can support printing both an object itself, and all of its contents.
While it is possible for us to simulate such a feature with a function that recursively calls three or more nested for-loops to print any possible values at any possible level of the item, this would be a highly inefficient approach to what should be a very useful tool. Not every project involves complicated tables, but the ones that do tend to use lots of them and to use them often.