So inside the folders array. I want to print out the 'name' of the folders that don't have null as their size.
let folders = [
{
name:'user_name',
size: 5455,
information: ' '
},
{
name:'untitled',
size: 545343,
information: 'no description'
},
{
name:'new_user',
size: null
}
];
So i've made this code in order to get the names of the folders that don't have null as their size but when I test it, it only prints out all the arrays. I can't quite figure out what I'm doing wrong.
folders.forEach((item) => {
let info = folders.filter((f) => {
if (f.size !== null);
return item.name
})
console.log(info)
});