Is there a Lodash or Underscore method which can find if an object has only the given keys of that object. I would like a Lodash or Underscore implementation even though this sounds trivial using native JS.
For example if my object looks like and assuming there is a lodash method named hasOnly
const obj = {
name: undefined,
age: 15,
school: 'Some school'
}
_.hasOnly(obj,['name','age']) //return false
_.hasOnly(obj,['name','age','city']) //return false
_.hasOnly(obj,['name','age','school']) //return true
I couldn't seem to find a way in the docs