Jquery

Find The Difference Of Two Arrays With JQuery

Posted by Weston Ganger on March 23, 2016

I came across this simple method using jQuery to get the difference of two arrays.


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]

Short and Sweet!


Related External Links:


Posted in Javascript and Tagged with jquery javascript 


Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts