I am having an issue with a piece of javascript that's evaluating to true when I do not want it to do so. When indexOf evaluates rec.name - which equals "CSI" - it returns true and triggers the continue line because the finalArr array contains an element named "CSIQ Group". However, that's not what I want, as I only want it to evaluate to true if it finds an element in the array that is an exact match.
Here's the snippet of code:
if(finalArr.join().indexOf(rec.name.toString()) > -1){
continue;
}
What can I change to prevent "CSI" from triggering the continue line when "CSIQ Group" is already in finalArr? Thanks!
Kind Regards, Joseph