I have the following enum :
enum ABC {
A = 'a',
B = 'b',
C = 'c',
}
I have the folloging method :
doSomething(enum: ABC) {
switch(enum) {
case A :
console.log(A);
break;
case B :
console.log(B);
break;
case C :
console.log(C);
break;
}
}
is it possible to call the method doSomething(enum: ABC) with one of the following strings : 'a', 'b', 'c'.
What I would like to do would be something like :
const enumA: ABC = ABC.getByValue('a'); // this would be like ABC.A
doSomething(enumA);
Is it something like this possible in typescript ?