This file contains 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
/* flatten function | |
Accepts an n-dimensional array | |
as an argument and returns a | |
1-dimensional array | |
Returns value for non-arrays | |
Uses recursion to drill down | |
into each array section | |
*/ | |
function flatten(val) { | |
// if not an array returns value |