I am looking to specifically identify if the second array contains any values matching a value from the first array, rather than comparing the arrays as a whole. The goal is to return the value that matches in both arrays.
To clarify, comparing two arrays as a whole would involve:
array1 = [1,2,3];
array2 = [1,3,4];
console.log(JSON.encode(array1)==JSON.encode(array2));
In this scenario, the focus is on checking for matching values in array2 compared to array1, rather than determining if the arrays are overall equivalent. Any assistance with this is greatly appreciated!