How to convert a multidimensional array into a single array
Originally posted here!
To convert a multidimensional or nested array into a single array or flatten the array we can use the flat() method available in the array.
Suppose you have a nested array like this,
// nested array
let arr = ["John Doe", ["L...
melvingeorge-me.hashnode.dev2 min read