Typescript enum usage

by Admin 2. January 2018 01:36
enum Answer {
    Accepted = 1, 
    Rejected = 2, 
    NotFound = 3 
}

type LogLevelStrings = keyof typeof Answer;

let foo = () : Answer  => {
const prev : LogLevelStrings = "Accepted"; return Choose[prev]; } console.log('running'); console.log(`foo:${foo()}`);

Tags:

Comments are closed

TextBox

Tag cloud

    RecentPosts