Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to get both key and value of enum in typescript

var enumValues=[];
for (var log in LogEntry) {
    if (!isNaN(Number(log))) {
       enumValues.push(log);
   }    
}
console.log(enumValues);

//Output
//["0", "1", "2", "3"]
Source by www.angularjswiki.com #
 
PREVIOUS NEXT
Tagged: #key #enum #typescript
ADD COMMENT
Topic
Name
8+1 =