Skip to content
JS
JavaScript error

TypeError

The JavaScript exception "right-hand side of 'in' should be an object" occurs when the in operator was used to search in strings, or in numbers, or other primitive types. It can only be used to check if a property is in an object.

Reference entryJavaScriptFetched
TypeError: Cannot use 'in' operator to search for 'x' in 'y' (V8-based & Firefox)
As listed by MDN Web Docs
TypeError: right-hand side of 'in' should be an object, got null (Firefox)
As listed by MDN Web Docs
TypeError: "y" is not an Object. (evaluating '"x" in "y"') (Safari)
As listed by MDN Web Docs
Category
TypeError
Severity
error
Runtime
both
or press Cmd/Ctrl + Enter. The text is only sent to this site to match it.
Source: MDN Web Docs. Data fetched 2026-09-25T01:48:37.274Z.