Iterate Through All an Array's Items Using For Loops what is the ==-1 for?

can someone tell me what the ==-1 does? I really dont understand this.

more context please

right now I can only tell that it is checking if something is equal to -1
what’s the other item of the comparison?

for (let i = 0; i < arr.length; i++) {
if (arr[i].indexOf(elem)== -1)

I am guessing it means if it does not exist.

indexOf return the index of the element, or if the element is not in the array, it returns -1

yes i see that in the documentation, but it doesnt make sense… why it would == -1…
I am guessing that -1 means in: if (arr[i].indexOf(elem)== -1)

as you loop through the array and compare each number to the elem and if it does not exist, then push the array to the newArray if does exist then do not push the array…

anyone please correct me if I am wrong… i want to make sure I am interpeting the code the right way.

I see only what you post, but yes, this mean “if elem is not included in arr[i], do something”