const users = [
{name: "shaun", premium: true},
{name: "yoshi", premium: false},
{name:"mario", premium: false},
{name:"chun- li", premium: true}
];
const premiumUsers = users.filter((user) => {
return user.premium ;
})
console.log(premiumUsers);
Im just curious as to why the filter method didnt return all of the values both false and true when the return is for user.premium and no distinction was made to actually filter out the false methods.
If I had to guess I would say that the filter method , when dealing with booleans automatically them as true unless they are false , but I am not sure.