Can someone SOLVE THIS!
else if(balls[0].color == "red" && balls[1].color == "red" && balls[2].color == "red" && balls[3].color == "red" && balls[4].color == "red" && balls[5].color == "red" && balls[6].color == "red" && balls[7].color == "red" && balls[8].color == "red" && balls[9].color == "red" && balls[10].color == "red" && balls[11].color == "red" && balls[12].color == "red" && balls[13].color == "red" && balls[14].color == "red"... etc Can someone simplify the conditional, if value in property in an object are whether blue or red (true). Im using this method but still struggling on it //method function Color(color){ this.color = color } let colors = [] for(var j = 0; j < ballNum; j++){ let color = "yellow" colors.push(new Color(color)) colorObj = colors[j] } var allBlue = Object.keys(colorObj).every(function(k){ if(colorObj[k] === "blue" ){ console.log("blue win") } if(colorObj[k] === "red"){ console.log("red win") }}); https://code.sololearn.com/WvDDRkLGPRV9/?ref=app