I want to loop through an array of numbers to see if it matches up with a variable that i want to check for. It's doing the check correctly but it's displaying the result every time it checks it. What i want it to do is....do the check and just spit out the result only once its finished. Is there a way to do that?
var myNumber = 123;
var sponsorNumber = [345, 234, 525];
angular.forEach(sponsorNumber, function(value) {
if (value !== myNumber) {
console.log('doesnt match!');
}
});