When attempting to use this array with a union type, TypeScript correctly identifies its type as string: "Argument of type 'string' is not assignable to parameter of type 'a' | 'b'."
function doSomething(value: 'a' | 'b'){}
['a', 'b'].map(e => doSomething(e));
Is there a method to define the types of the array elements? If not, what other approach can be taken to address this issue without using casting in map()?