Skip to content

Instantly share code, notes, and snippets.

@KoryNunn
Created May 24, 2016 03:39
Show Gist options
  • Select an option

  • Save KoryNunn/c1637826abbf7c32059f4e5af8fd2872 to your computer and use it in GitHub Desktop.

Select an option

Save KoryNunn/c1637826abbf7c32059f4e5af8fd2872 to your computer and use it in GitHub Desktop.
get distinct keys in N objects
function uniqueKeys(objects){
return Object.keys(objects.reduce(function(result, object){
for(var key in object){
result[key] = true;
}
return result;
}, {}));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment