Featured
- Get link
- X
- Other Apps
Typescript Get Array From Union Type
Typescript Get Array From Union Type. It doesn't know that fookeys[0] is fizz and that fookeys[1] is buzz, but still, better than the string[] you get with object.keys(). To create the array, you get typescript to recognize that fookeys has the type (fizz | buzz)[].

It results in an array that typescript recognizes as having elements that are a union of the interface's keys; In vs code, you can also set up a. To create the array, you get typescript to recognize that fookeys has the type (fizz | buzz)[].
It Results In An Array That Typescript Recognizes As Having Elements That Are A Union Of The Interface's Keys;
It doesn't know that fookeys[0] is fizz and that fookeys[1] is buzz, but still, better than the string[] you get with object.keys(). In vs code, you can also set up a. To create the array, you get typescript to recognize that fookeys has the type (fizz | buzz)[].
Comments
Post a Comment