I have an object with few properties true/false, I need to return an array with only the property name with true.
I have tried Object.entries but not sure how to create an array now.
const inputs = {
a: true,
b: true,
c: false
}
// result should be ['a','b']
// i have tried so far this one with no success
// const result = Object.entries(inputs).map((x, idx) => console.log(x))
Object.keys(inputs).filter(key => inputs[key]);