Question: I have a list of Id contained in an array :

```
var listId: string[] = [];
var newId: boolean;
for (let i in data.chunk) {
    listId.push(data.chunk[i].aliases[0]);
}

```

I then want to test my new Id with this whole list. If my new Id is in the list I want to return a false, and if it is not returned a true.

```
for(let i of listId) {
    if(member.userId !== listId[i]) {
      newid = true;
    }
    else {
      newId = false;
    }
  }

```

I do not see how to do it .. My proposed solution does not work

Answer: 
Try this

```
    if(listId.indexOf(member.userId) !== -1)
     {
      newId = false; 
     }else
      {
       newid = true;
      }

```
This will work too

```
return !listId.some(id => member.userId === id);

```