Flatten Array

Flatten Array

Given an array of indeterminate depth (dimensions), return a flattened version of the original array.

function flatten(arr) {
    
}

let arr = [1, 2, [3]]
flatten(arr)  // returns [1, 2, 3];

let arr2 = ["hello", ["this", "is", ["a", "4 dimensional", ["array"]]]];
flatten(arr2)  // returns ["hello", "this", "is", "a", "4 dimensional", "array"];

Hint

This is a perfect example of a good time to use recursion.