const ReadOnlyStrings = ['a', 'b', 'c'] as const;
const fn = (key: string)=>{
ReadOnlyStrings.includes(key);
}
Errors in code:
Argument of type 'string' is not assignable to parameter of type '"a" | "b" | "c"'.
How to advoids the error?
const ReadOnlyStrings = ['a', 'b', 'c'] as const;
const fn = (key: string)=>{
ReadOnlyStrings.includes(key);
}
Errors in code:
Argument of type 'string' is not assignable to parameter of type '"a" | "b" | "c"'.
How to advoids the error?