How can I convert a Set (eg, {2,4,6}) to an Array [2, 4, 6] in TypeScript without writing a loop explicitly ?
I have tried those following ways, all of them work in JavaScript but none of them work on TypeScript
[...set] // ERR: "Type 'Set<{}>' is not an array type" in typescript
Array.from(set) // ERR: Property 'from' does not exist on type 'ArrayConstructor'
You also can do
Array.from(my_set.values());