TypeScript What 'string & {}' mean meaning?
Give an example, we define a Color type:
type Color = "primary" | "secondary" | string;
Then we use it like this:
const color: Color = "primary";
But there’s an issue:
We aren’t getting color suggestions when we use the Color type.
We want primary...
nhannguyen.hashnode.dev1 min read