I’m trying to filter duplicates from array of array elements into a single array removing duplicates.
Below is the snippet
const arr = [
[1, 2],
[1, 2, 3]
]
const result = arr.map((res) => [...new Set(res)]);
console.log(result)
The expected output is [1,2,3]
. Could anyone please help?