Answers for "typescript enum to array"

2

typescript enum to array

// Helper
const StringIsNumber = value => isNaN(Number(value)) === false;

// Turn enum into array
function ToArray(enumme) {
    return Object.keys(enumme)
        .filter(StringIsNumber)
        .map(key => enumme[key]);
}
Posted by: Guest on August-23-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language