1. Typescript enumeration type
// create enumeration
enum myenum { up , Down , left , Right }
// use enum type
function numtion (event: myenum ) {
console.log(event)
}
numtion(myenum .left)
describe:
1. Use enum to define enumeration
2. It is agreed that the enumeration name starts with a capital letter
3. Pass between multiple values in the enumeration, separated by commas
4. After defining the enumeration, use the enumeration name directly as the type annotation