I have the following data structure:
const arr = [
{key: 0, x: [], y: []},
{key: 0, x: [], y: []}
]
I want to check if all arrays are empty, I have how can I do this using reduce? My code so far:
arr.reduce((count, acc) => {
return acc !== 'key' ? count + acc.length : count
}, 0)