var array1 = [1, 3, 4, 5];
var array2 = [1, 3, 6, 7];
I have two arrays like above. Now I want to do the following in MVC 4 with jQuery.
1) If every elements of both arrays are equal then show a message/alert. e.g. "All records already existing."
2) If every elements of both the arrays are different then just add them all in a "VAR", e.g. var resultset = the output
3) If few elements common between two arrays then for the common elements show a message with element, e.g. "Record 1,3 already exists" and add the different elements in "VAR", e.g. var resultset = .... (where 4,5,6,7 will stored). Both the message and difference elements collection will perform at the same time.