Check out example codes for "enum in ts". It will help you in understanding the concepts better.

Code Example 1

enum AnEnum {
    One = 1,
    Two = 2
}
let stringOne = AnEnum[1]; // "One"
let stringTwo = AnEnum[AnEnum.Two]; // "Two"

Code Example 2

enum Response {
    No = 0,
    Yes = 1,
}

function respond(recipient: string, message: Response): void {
    // ...
}

respond("Princess Caroline", Response.Yes)

Code Example 3

enum Direction {
    Up,
    Down,
    Left,
    Right,
}

Learn ReactJs, React Native from akashmittal.com