我有一个这样的枚举:
enum Test {
'type1',
'type2',
'type3',
'type4',
'type5'
}
function getType(num: number) {
}
Run Code Online (Sandbox Code Playgroud)
我想要的是如果num = 1,返回type1,如果num = 2,返回type2,如果num >= 5,返回type5。
我怎样才能做到这一点getType?