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