var a=["a","b","c","d"];
var b=["b","a","c","d"];
I need output like:
mismatched array from a
mismatch array=["a", "b"];
var a=["a","b","c","d"];
var b=["b","a","c","d"];
I need output like:
mismatched array from a
mismatch array=["a", "b"];
2
Answers
You can use filter function and check value with the index in both the array and then you can get the mismatched values from a.
Here I used Javascript’s filter method to get the mismatched Array.