Limiting the parameters that can be used within a TypeScript function
If you want only a certain value of the parameter that can be used inside your TypeScript function then you can use the literal type to do so as shown in the following lines of code. The TypeScript program above will generate the following error during compilation because 6 is not the permitted parameter inside…
Read More “Limiting the parameters that can be used within a TypeScript function” »