如何在不显式编写循环的情况下,将集合(例如,{2,4,6})转换为TypeScript中的数组[2,4,6]?
我try 过以下几种方法,它们都可以在JavaScript中工作,但没有一种可以在TypeScript上工作
[...set] // ERR: "Type 'Set<{}>' is not an array type" in typescript
Array.from(set) // ERR: Property 'from' does not exist on type 'ArrayConstructor'