Sunny
@sunny90
283 Following
205 Followers
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
Array.flat() method in JavaScript is used to flatten an array of arrays into a single-level array.
const arr = [1, 2, [3, 4], [5, 6], 7];
const flatArr = arr.flat();
console.log(flatArr);
// Output: [1, 2, 3, 4, 5, 6, 7] 0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
1 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
0 reaction
0 reply
0 recast
1 reaction
0 reply
0 recast
0 reaction