flat

JavaScript Recursion Exercise

Koowoy
Flatten Create a function that flattens all nested arrays in the given array. My initial instinct was to use the JavaScript function .flat() and recursion. However, a problem occurred with the base case. In order for recursion to function correctly, the base case needs to be set to determine if the recursion should stop. In my above solution, I wanted to compare the array before and after flattening it.