Answer the question
In order to leave comments, you need to log in
What is the correct way to use indexOf()?
Greetings, I have conditionally three objects.
a = {value: 'ST'};
b = {value: 'AP'};
c = {value: 'STT'};
const arr = [ this.a, this.b, this.c];
const simple = 'ST';
for (const el of arr) {
if (el.value1.indexOf(simple) !== -1) {
console.log(el);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question