Skip to content

Instantly share code, notes, and snippets.

@dustinpoissant
Created November 22, 2016 03:49
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 dustinpoissant/faf975f6a7b9cb915398931cb302fda4 to your computer and use it in GitHub Desktop.
Save dustinpoissant/faf975f6a7b9cb915398931cb302fda4 to your computer and use it in GitHub Desktop.
A quick and dirty check to see of one object contains another.
function containsObject(a,b){for(var c in a)if(!b[c]||a[c]!=b[c])return!1;return!0}
function containsObject(test, object){
for(var k in test){
if(
!object[k] ||
test[k] != object[k]
) return false;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment