Implement and export as default a function that makes a nested array flat.
To solve the task, you cannot use built-in array flattening methods.
const list = [1, 2, [3, 5], [[4, 3], 2]]; flatten(list); // [1, 2, 3, 5, 4, 3, 2]
- method checks if data is array
For full access to the challenge you need a professional subscription.
A professional subscription will give you full access to all Hexlet courses, projects and lifetime access to the theory of lessons learned. You can cancel your subscription at any time.