Created
April 19, 2019 19:17
-
-
Save DDzia/eaa2dc5bf712fd2c3c5caa632a504d4a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sample from stack overflow. | |
* @see https://stackoverflow.com/a/18112157 | |
*/ | |
function getValues(enumType: object) { | |
for (var enumMember in enumType) { | |
var isValueProperty = parseInt(enumMember, 10) >= 0 | |
if (isValueProperty) { | |
console.log("enum member: ", enumType[enumMember]); | |
} | |
} | |
} | |
// run to check | |
getValues(Names); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment