I have a function called "howmanyOnline" that receives an object users
.
Each user has a property online
which is a boolean. It should return the number of users with the property online equal to true.
For example How many Online (users) returns 2 this the object of object:
let users = {
Victor: {
age: 33,
online: true
},
joan: {
age: 25,
online: true
},
frank: {
age: 25,
online: false
},
Emy: {
age: 24,
online: false
}
};
function howmanyOnline(users) {
}
How can I do this?