This is a fairly fundamental question, but I'm looking for the best solution. I have 2 javascript String arrays . Let's say
A: ["Stark", "Targaryen", "Lannister", "Baratheon"]
B: ["Greyjoy", "Tyrell", "Stark"]
Since "Stark" is repeated, I want to remove it from array A, and my result should be (keeping order)
A: ["Targaryen", "Lannister", "Baratheon"]
I really don't care about the second array of B. Is there something mostly javascript or jQuery that would help me? PS: Do not send nested for loops with IF statements. Maybe something smarter :)
karan source
share