Skip to content

Instantly share code, notes, and snippets.

@koresar
Last active August 29, 2015 14:04
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 koresar/c1dfd7ab07d6b695673b to your computer and use it in GitHub Desktop.
Save koresar/c1dfd7ab07d6b695673b to your computer and use it in GitHub Desktop.
function getUniqueKeys() {
var keys = [];
_.forEach(behaviors, function (behavior) {
keys.push(Object.keys(behavior.parametersTemplate));
}.bind(this));
return _.uniq(_.flatten(keys));
}
// OR
return _.uniq(_.flatten(_.map(_.pluck(behavior, 'parametersTemplate'), _.keys)));
@koresar
Copy link
Author

koresar commented Jul 23, 2014

А ещё bind(this) лишний совсем.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment