![typescript - Object literal may only specify known properties, and 'name' does not exist in type but the type exists - Stack Overflow typescript - Object literal may only specify known properties, and 'name' does not exist in type but the type exists - Stack Overflow](https://i.stack.imgur.com/qPHKy.png)
typescript - Object literal may only specify known properties, and 'name' does not exist in type but the type exists - Stack Overflow
Minko Gechev on Twitter: "Const assertions in TypeScript allow you to define literal values where: - object literals get readonly properties - array literals become readonly tuples - literal types don't get
![Replace your switch statement and multiple "if and else", using Object Literals - [en-US]. - DEV Community Replace your switch statement and multiple "if and else", using Object Literals - [en-US]. - DEV Community](https://res.cloudinary.com/practicaldev/image/fetch/s--ET6rNUZx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/y5xlip29lnylnfhmhwj8.png)