How to use string enum that initialized with strings in TypeScript

1 Answer

0 votes
enum Languages {
    TypeScript = "Microsoft",
    Java = "Web + Desktop",
    Python = "AI",   
    CPP = "ALL",
    PHP = "Web"
}

console.log(Languages.TypeScript); 
console.log(Languages.Java); 
console.log(Languages.Python); 
console.log(Languages.CPP);  
console.log(Languages.PHP);  



 
/*
 
run:
 
"Microsoft" 
"Web + Desktop" 
"AI" 
"ALL" 
"Web" 

*/

 



answered Oct 23, 2021 by avibootz

Related questions

3 answers 167 views
167 views asked Oct 23, 2021 by avibootz
1 answer 136 views
1 answer 99 views
1 answer 126 views
1 answer 105 views
1 answer 107 views
...