Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Share On Stumbleupon
Contact us
Hide Buttons

Remove the elements of one array from another using underscore or raw javascript

It so happened that I wanted to get all the elements of the first array that were not present in the second array.

Below are examples of getting the difference between two arrays using raw javascript and lodash or underscore.

Using raw javascript

Using underscore or lodash

If you are using lodash or underscore, you have a couple of alternatives.

Ryan Sukale

Ryan is just a regular guy next door trying to manage his life and finances.