I have a situation where i want to check if elements in one array are present in another array. If elements are present, then push those in new array. In this case, i have array of strings.
For e.g.
var check = ["6003", "6005", "6010"]; //static values. I need to check these elements if they are present in InputValues
var InputValues = ["5005", 2005", "6010"]; //dynamic input values
var result = ["6010"]; //dyanimic final array based off elements in InputValues
Similary,
var InputValues = ["5005", 6005", "6010"];
var result = ["6005", "6010"];
Can someone please let me know how to achieve this dynamic result.