I'm trying to convert this code I wrote into chained functions since I thought it would look cleaner.
let z =this.parkinglot.filter(val=>{
let propArr = Object.entries(val.spaces);
let pass = propArr.some(w=>{
let [key,value] = w;
return (value > 0);
})
return (pass===true);
})
My data structure is an array of objects that looks like this (Stored in an array called this.parkinglot)

When I attempt to rewrite this as chained function, I run into the problem of giving the proper input to my functions. Since I need the inner data I needed to use a map but now I have an 3 Layered Array.
Then I ran into the problem of how would I then give this data to filter properly.
let t = this.parkinglot.map(val => Object.entries(val.spaces))
.some(w=>{
console.log('aa',w);
// let [key,value]=w
//return (value > 0);
})
//.filter(z=>z>1)
return arr.some...instead oflet pass = arr.some..; return pass===true.somereturns boolean value so can't chain them like this(pass === true), instead just usepass