Last active
February 23, 2021 23:57
-
-
Save commanderh/34eea53644680187ddfd94a585ebc0d8 to your computer and use it in GitHub Desktop.
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
/*********************************************************************** | |
Write a recursive function called `flatten` that takes a single array with | |
any number of nested arrays and returns and array with all the nested | |
contents on one level. | |
Examples: | |
flatten([]); // [] | |
flatten([1, 2]); // [1, 2] | |
flatten([1, [2, [3]]]); // [1, 2, 3] | |
***********************************************************************/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment