Skip to content

Instantly share code, notes, and snippets.

@lydemann
Last active December 8, 2018 09:45
Show Gist options
  • Save lydemann/7ca18719f4789460cac00aa067deaf2c to your computer and use it in GitHub Desktop.
Save lydemann/7ca18719f4789460cac00aa067deaf2c to your computer and use it in GitHub Desktop.
var nestedObject = {
data: {
info: {
stuff: {
thing: {
moreStuff: {
someVal: 40,
something: 'foo2'
}
}
}
}
}
}
let hasIt = containsInNestedObject(nestedObject, 40); // true
let doesntHaveIt = containsInNestedObject(nestedObject, "foo"); // false
console.log(hasIt, doesntHaveIt);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment