Created
March 1, 2017 14:42
-
-
Save zxsanny/2bf414c92ff21d008a4765177574c146 to your computer and use it in GitHub Desktop.
This file contains 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 zxdiff(arr, arrDiff, propFn) { | |
var hash = []; | |
for (var x = 0; x < arrDiff.length; x++) { | |
hash[propFn(arrDiff[x])] = true; | |
} | |
var res = []; | |
for (var i = 0; i < arr.length; i++) { | |
if (!hash[ propFn(arr[i]) ]) { | |
res.push(arr[i]); | |
} | |
} | |
return res; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment