chris-ELM
4/6/2014 - 6:49 PM

Array difference From https://news.layervault.com/stories/19629-favorite-code-snippets

Array.prototype.diff = function(that) {
    return {
        enter: $(that).not(this).get(),
        exit: $(this).not(that).get()
    };
};

//Example:
//var result = [0,1,2,3,4,5].diff([1,2,3,4,5,6,7]); 
// result will be {enter:[6,7], exit:[0]}
// 6 and 7 are added, 0 is removed