How do you check if a value is an object in JavaScript?
const isObject = function(obj) { const type = typeof obj; return type === 'function' || type === 'object' && !!obj; };
!!obj is shorthand for checking if obj is truthy (to filter out null)
!!obj
obj
null