I have an array containing a list of IDs:
var listId: string[] = [];
var newId: boolean;
for (let i in data.chunk) {
listId.push(data.chunk[i].aliases[0]);
}
My objective is to compare a new ID with the entire list. If the new ID is found in the list, I want to return false; otherwise, true.
for(let i of listId) {
if(member.userId !== listId[i]) {
newid = true;
}
else {
newId = false;
}
}
I am struggling to achieve this task as my proposed solution is not functioning correctly.