Skip to content

Instantly share code, notes, and snippets.

@jtreeves
Created December 5, 2020 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtreeves/accfc41a2a768dc16b18f51b6287fcca to your computer and use it in GitHub Desktop.
Save jtreeves/accfc41a2a768dc16b18f51b6287fcca to your computer and use it in GitHub Desktop.
for (let i = 0; i < mainArray.length; i++) {
for (let j = 0; j < otherArray.length; j++) {
if (mainArray[i].commonKey === otherArray[j].commonKey) {
mainArray[i].newKey = otherArray[j]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment