Last active
August 29, 2015 14:04
-
-
Save koresar/c1dfd7ab07d6b695673b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
А ещё bind(this) лишний совсем.