To convert a JavaScript iterable to an array, we use the spread operator.
For instance, we write
const x = new Set([1, 2, 3, 4]);
const z = [...x];
to create a set with the Set
constructor.
Then we convert the set to an array with the spread operator.