Compare two arrays and return a new array with any items only found in one of the original arrays.


/ Published in: JavaScript
Save to your folder(s)

Compare two arrays and return a new array with any items only found in one of the original arrays.
ex.,
[1, "calf", 3, "piglet"], [1, "calf", 3, 4] should return ["piglet", 4].

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.