Skip to content
JS
JavaScript error

TypeError

The JavaScript strict mode exception "can't assign to property" occurs when attempting to create a property on primitive value such as a symbol, a string, a number or a boolean. Primitive values cannot hold any property.

Reference entryJavaScriptFetched
TypeError: Cannot create property 'x' on number '1' (V8-based)
As listed by MDN Web Docs
TypeError: can't assign to property "x" on 1: not an object (Firefox)
As listed by MDN Web Docs
TypeError: Attempted to assign to readonly property. (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.273Z.