I'm working with an array within my data function where I need to calculate the sum of numbers that have a false record. The challenge I'm facing is setting up the logical parameter for computing only the false arrays. How should I define this condition in the computed section?
Array1: [
{Text1: "Some text in an array 1", Numbers: Math.floor(Math.random() * 50), B1: true},
{Text2: "Some text in an array 2", Numbers: Math.floor(Math.random() * 50), B1: true},
{Text3: "Some text in an array 3", Numbers: Math.floor(Math.random() * 50), B1: true},
{Text4: "Some text in an array 4", Numbers: Math.floor(Math.random() * 50), B1: true},
{Text5: "Some text in an array 5", Numbers: Math.floor(Math.random() * 50), B1: true},
{Text6: "Some text in an array 6", Numbers: Math.floor(Math.random() * 50), B1: false},
{Text7: "Some text in an array 7", Numbers: Math.floor(Math.random() * 50), B1: false},
{Text10: "Some text in an array 8", Numbers: Math.floor(Math.random() * 50), B1: false},
{Text8: "Some text in an array 9", Numbers: Math.floor(Math.random() * 50), B1: false},
{Text9: "Some text in an array 10", Numbers: Math.floor(Math.random() * 50), B1: false},
],
sum: 0
computed:{
sumOfNumbers(){
return this.Array1.reduce((sum, numbers) =>{
return sum += numbers.Numbers;
}, 0)
},
sumOfFalse(){
if(Array1[iii].B1 = 'false'){
return this.Array1.reduce((sum, numbers) =>{
return sum += numbers.Numbers;
}, 0)
}
},
},