A recursive check to test whether a property and any number of sub-keys are an object (similar to optional chaining).
Examples:
const colors = {
orange: true,
blue: false,
red: {
dark: true,
light: false,
seeAlso: ['pink'],
},
};
isObject(colors) // true
isObject(colors, 'orange') // false
isObject(colors, 'red') // true
isObject(colors, 'red', 'dark') // false
isObject(colors, 'red', 'seeAlso') // true