I'm using Ionic 4 and i'd like to know how could I check if an array is NOT on other array to make a condition, but it doesn't work, what i'm doing wrong?
method() {
if (!this.array.includes(['Web development', 'Football'])
) {
console.log(this.array)
//doSomething
}
UPDATED
once click on a button, imDone method starts. What i want exactly is once clicked, if the iDislike array (all this words) arent on the arrayChip, then do something
ngOnInit() {
this.arrayChip = [
'4',
"4",
'5',
'5',
'7',
'34',
'1',
'9',
'7',
'9',
'4',
'3',]
}
imDone() {
let iDislike = ['Web 3', '2', '4', '5', '6']
const includesListOfItemsToCheck = this.arrayChip.some(subArray =>
iDislike.every(item => subArray.includes(item)));
console.log(includesListOfItemsToCheck)
console.log('arrayChip: ' + this.arrayChip)
}