js easy way to flatten an array code example
Example 1: flatten nested array javascript
const arr2 = [1, 2, [3, 4, [5, 6]]];
arr2.flat();
Example 2: js .flat
const arrays = [
["$6"],
["$12"],
["$25"],
["$25"],
["$18"],
["$22"],
["$10"]
];
const merge3 = arrays.flat(1); //The depth level specifying how deep a nested array structure should be flattened. Defaults to 1.
console.log(merge3);