Transcript from the "Flattening an Array Exercise" Lesson
>> So this next one is, it's more race because I love the race. This next problem is one that I've gotten multiple times at many different interviews. It is without using that flat, which is a new method, which didn't exist until this year. Which will do this for you.
[00:00:20] But without using .flat, create a function that will flatten an array. And by flattening an array it means, it's an array of arrays, of arrays, it doesn't matter how deeply nested it is. Then I want you to take out all the arrays and just give me one arrays, with all the values into one array.
[00:00:36] Any questions on this one you would ask in an interview right now? Yes.
>> So we don't know what the structure of example array is necessarily? I mean, it is an example, but can it add more levels or less levels?
>> It could have no levels.
>> It could just be an array of numbers. It might have 30 different arrays nested within each other. You don't know that. And this is a question that like I said, I've gotten in multiple interviews before, so chances are at some point you'll probably run into this one.
[00:01:12] And give another hint, I shouldn't give you so many hints, using recursion for this one will help you out. It makes it easier to reason about. You don't have to use recursion. You could do it, I won't say anything else.