Last Updated: May 23, 2017
·
640
· Codi

Find / compute the difference between two arrays in Javascript

There is a lightweight array-diff open source component you can use for finding the difference between two Javascript arrays.

Here is an example:

diff([1,2,3], [1,2,3,4,5]) // => [4,5]

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside