Do you know what will be the output of this code?
JavaScript
console.log([...new Set([1, 1, 2, 3, 3])]);
Show answer and explanation
The answer is [1, 2, 3].
Set ignores values it already has. Spreading it into [...] turns it back into an array, keeping the original order.