Skip to content

Instantly share code, notes, and snippets.

@techniq
Created October 1, 2014 19:38
Show Gist options
  • Select an option

  • Save techniq/3b3756f66369fe7ab3ab to your computer and use it in GitHub Desktop.

Select an option

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