How to iterate through enums with integer as value in Typescript?

Discussão em 'Angular' iniciado por Hey Itsme, Novembro 12, 2024.

  1. Hey Itsme

    Hey Itsme Guest

    I have an enum

    export enums Actions {
    All = 1,
    Success = 2,
    Failed = 3
    }


    When I iterate through it using for loop, I am getting total of 6 entries. I get to know that this is how it works in Typescript. But how can I use the enum so that I can access

    enum.key


    for "All, Success, Falied" and

    enum.value


    for 1,2,3

    Continue reading...

Compartilhe esta Página