Get union of arrays | JavaScript

April 25th, 2021 09:55:18 PM

					
const union = (...arr) => [...new Set(arr.flat())]; // Example union([1, 2], [2, 3], [3]); // [1, 2, 3]

Featured Posts