This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) { |