JavaScript 2019 - New Features
Array.flat() function
The flat() method concatenates all sub elements of an array and returns a new array.The programmer can identify the depth of sub elements. The default depth is 1.
// Array.flat
let nestedArray = [1, [2, [3]]];
const flattened = ...
mahavir.hashnode.dev3 min read