isAnyObjectWith({ a: 1 }, 'a'); // true
isAnyObjectWith({ a: 1 }, 'b'); // false
isAnyObjectWith({ a: 1, b: 2 }, ['a', 'b']); // true
isAnyObjectWith({ a: 1 }, ['a', 'b']); // false
isAnyObjectWith({}, 'toString'); // true (inherited properties are included)
isAnyObjectWith(['a'], 0); // true (arrays are objects)
isAnyObjectWith(null, 'a'); // false
Determine if
inputis an object and has the provided property or properties.