Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save StevenMDixon/953928079109a3d1fa013040e0de4560 to your computer and use it in GitHub Desktop.
Save StevenMDixon/953928079109a3d1fa013040e0de4560 to your computer and use it in GitHub Desktop.
we start with two alike arrays that need to be combined, the output should combine items that are exactly the same.
let array_one = [{name: "cats", count: 1},{name: "dogs", count: 2}];
let array_two = [{name: "cats", count: 5}, ,{name: "chickesn", count: 4}];
// expected output [{name: "cats", count: 6},{name: "dogs", count: 2} ,{name: "chickesn", count: 4}}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment