So basically I have this code:
Array.prototype.inState = function (needle, haystack) {
let index = this.findIndex(value => value[needle] === haystack);
return index === -1;
};
and it works fairly enough to check if the given needle is exists in the react state or not. but ESlint keep saying that:
Array prototype is read only, properties should not be added no-extend-native
so my question is: What is wrong with my code ?