Created
January 12, 2015 11:34
-
-
Save tarzak/8e3f4c719f87da698ba8 to your computer and use it in GitHub Desktop.
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 compare(arr1, arr2) { | |
for(var i = 0; i < arr1.length; i += 1) { | |
for(var j = 0; j < arr2.length; j += 2) { | |
if (arr1[i].id === arr2[j].id) { | |
arr1.splice(i,1,arr2[j]); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment