var array1 = [1, 2, 3, 4, 5, 6];
var array2 = [1, 2, 3, 4, 5, 6, 7, 8, 9];
var difference = [];
jQuery.grep(array2, function(el) {
if (jQuery.inArray(el, array1) == -1) difference.push(el);
});
alert(" the difference is " + difference); // Changed variable name
var array_one = [1,2,3,4];
var array_two = [3,4,5,6]
var difference = $(array_one).not(array_two).get();
console.log(difference);
// [1,2,5,6]