What is the best way to use `javascript isObject` to check if a value is a real object?

Totally agree with both of you! When working in larger codebases (or with data crossing between windows/iframes), I usually bring in Lodash-it’s just easier and saves time handling quirks.

_.isPlainObject(val);

:white_check_mark: Why use Lodash’s isPlainObject?

  • Handles cross-realm objects (like from iframes)
  • Ignores arrays, functions, class instances, etc.
  • Clean and production-safe

Yes, it does mean adding Lodash (npm install lodash), but if you’re already using it, this is probably the most robust way to handle javascript isobject checks without reinventing the wheel.