4 ms·
The same is true for Typescript, hence the userType's restriction to 'customer' and 'admin'. Though the initial sample code is wrong anyway - note the missing
by qayxc 4y ago
The same is true for Typescript, hence the userType's restriction to 'customer' and 'admin'.
Though the initial sample code is wrong anyway - note the missing "break" statements inside the switch.
- JoeyJoJoJr 4y agoIt’s not only true for Typescript, but often times necessary if you require dynamic behaviour that would otherwise be achieved through reflection.