Skip to content

Instantly share code, notes, and snippets.

@ivanlawrence
Created May 2, 2019 21:24
Show Gist options
  • Select an option

  • Save ivanlawrence/45bc9d10c56bbbd9e5319b0017d555a1 to your computer and use it in GitHub Desktop.

Select an option

Save ivanlawrence/45bc9d10c56bbbd9e5319b0017d555a1 to your computer and use it in GitHub Desktop.
So I don't forget
function joinObjs() {
// loops through all arguments and joins them together
const result = {};
for (var i = 0, j = arguments.length; i < j; i++){
Object.keys(arguments[i])
.forEach(key => result[key] = arguments[i][key]);
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment