I have this array and I want to to get a boolean(true) if there is a 'three' that is equal to 9
myArr = [ { apple: 6, basket: [ { one: 1, two: 2, three: 3 }, { one: 4, two: 5, three: 6 } ] }, { apple: 9, basket: [ { one: 1, two: 2, three: 3 }, { one: 4, two: 5, three: 9 } ] } ]
What I tried:
enter code here
this.myArr.forEach( data => {
if(data.basket.filter(cur => cur.one === 0 || cur.three === 9)) {
console.log('true')
}
})
This always logs true for some reason I don't know why.