Let my object have the following data:
{
mongoose: {
name: "Starky",
age: 3,
playful: false
},
dog: {
name: "Maks",
age: 7,
playful: false
},
parrot: {
name: "Petty",
age: 4,
playful: true
}
}
How can I count the number of booleans?
I know that I can use .reduce
, but I didn’t understand exactly how to use it correctly, in an attempt to use it, I just got undefined
.