Skip to content

Instantly share code, notes, and snippets.

@techniq
Created October 1, 2014 19:38
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 techniq/3b3756f66369fe7ab3ab to your computer and use it in GitHub Desktop.
Save techniq/3b3756f66369fe7ab3ab to your computer and use it in GitHub Desktop.
Find unique object keys across an array of objects
var _ = require('lodash');
var allKeys = _.map(items, function(i) { return Object.keys(i); });
var uniqueKeys = _.uniq(_.flatten(allKeys));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment