i have an array of values that i want to check for to see if it contains 3 specific values and if it does not, i would like to check which ones that the array does not contain.
3 values:
'docx', 'pdf', 'jpg'
array:
var comps = [
{ file: 'docx' },
{ file: 'pdf' },
{ file: 'txt' },
{ file: 'png' },
{ file: 'pdf' }
]
function:
function checkCodes () {
angular.forEach( comps, function (comp) {
if(comp.file === 'docx' && comp.file === 'pdf' && comp.file === 'jpg') {
return true;
} else {
return false;
}
})
}
currently i think its looping over one at a time so it always returns false based on that only 1 value is being checked at a time.