Is there a way I can achieve this code in a more efficient way ? because looping on a very big scores array just to find one score property is very costly
var scores = [{scoredBy:"youssef",score:5},{scoredBy:"omar",score:3}];
scores.forEach(score=>{
if(score.scoredBy == "youssef"){
console.log(score);
}
})
.forEach, use.find()