Convert Boolean Value with true into an array in Angular4 (Typescript)

Discussão em 'Angular' iniciado por Chan Yoong Hon, Dezembro 12, 2024.

  1. I am getting a set of boolean values from my microservice.

    "mon": true,
    "tues": false,
    "wed": false,
    "thurs": true,
    "fri": false,
    "sat": true,
    "sun": false,


    And I need to convert the values with boolean value true to an array like following:

    options = ['mon', 'thurs', 'sat']

    How can I do it?

    Continue reading...

Compartilhe esta Página