Skip to content

Instantly share code, notes, and snippets.

// Why would we do this? Well, JSON structure and NoSQL concepts come into play here:
// aka a document having a collection of authors, collection of editions, collection
// of chapters, each of those "sub arrays" having other subarrays and so on
// the following is javascript syntax - although I believe JS now has its own .flatten()
// method - I decided to code this out with recursion. It may be interesting to code this
// up in python and java as well to see how the code base compares
// for now, going to limit this to expect an array passed
function myFlatten(inArr) {