If I have a list of objects, how can I check if elements in the list are empty objects. I feel like this should be straight forward however it confuses me a little because when I do something like this in my react function component
console.log(list[0])
It will output {}
on every render in my react component
However when I do something like
if (list[0] == {}){
console.log('empty')}
It never ends up reaching there. Is there a cleaner way to check if objects inside a list are empty? Or preferably if all the objects in a list are empty? I feel like im missing something very obvious but im not sure why it wouldnt reach the log in the if conditional.