JavaScript: Flatten an array recursively
19 February 2023 (Updated 19 February 2023)
[2, 4, [5, [6, [7, [8]]]]].flat(Infinity)
// => [2, 4, 5, 6, 7, 8]
Tagged:
JavaScript
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment