I looked at this very popular SO question:
How to merge two arrays of JSON objects
Where the OP has this:
var array1 = ["Vijendra","Singh"];
var array2 = ["Singh", "Shakya"];
Then he says, "I want the output to be:"
var array3 = ["Vijendra","Singh","Shakya"];
My question is "How do you just get Singh as a result?"
var array3 = ["Singh"];
In other words, how do you combine two arrays and only keep data that are common to both? I've looked at merge, concat, intersect, and other options, but I can't seem to get this.