[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Errors/Cant_redefine_property [Back]  [Original]

TypeError: can't redefine non-configurable property "x" - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

TypeError: can't redefine non-configurable property "x"

TypeError: can't redefine non-configurable property "x" (Firefox)
TypeError: Cannot redefine property: "x" (Chrome)

TypeError

configurable (writable ) Object.defineProperty()

Object.defineProperty

Object.defineProperty()

js
var obj = Object.create({});
Object.defineProperty(obj, "foo", { value: "bar" });

Object.defineProperty(obj, "foo", { value: "baz" });
// TypeError: can't redefine non-configurable property "foo"

"foo"

js
var obj = Object.create({});
Object.defineProperty(obj, "foo", { value: "bar", configurable: true });
Object.defineProperty(obj, "foo", { value: "baz", configurable: true });


Web Proxy Viewer  |  New URL  |  Original Page