Skip to content

Instantly share code, notes, and snippets.

@sapher
Created January 12, 2014 05:32
Show Gist options
  • Save sapher/8381345 to your computer and use it in GitHub Desktop.
Save sapher/8381345 to your computer and use it in GitHub Desktop.
Test with Underscore/Lodash if an object contains same keys as another array
var array = ["email", "password", "username"];
var search = ["email", "password"];
console.log(_.every(search, _.partial(_.contains, array)));
//true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment