Last active
August 29, 2015 14:26
-
-
Save mdixon47/e1ff0079b3e8c83f5180 to your computer and use it in GitHub Desktop.
FCC Diff Two Arrays Challenge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function diff(arr1, arr2) { | |
| return arr1.filter(function (e) { return arr2.indexOf(e) < 0; }).concat(arr2.filter(function (e) { return arr1.indexOf(e) < 0; })); | |
| } | |
| diff([1, 2, 3, 5], [1, 2, 3, 4, 5]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment