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

TypeError: property "x" is non-configurable and can't be deleted( "x" ) - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

TypeError: property "x" is non-configurable and can't be deleted( "x" )

TypeError:  delete  'x'      (Edge)
TypeError:  "x"       . ( Firefox)
TypeError:     "x"  #<Object> (Chrome)

In this article

TypeError in strict mode only.

?

, . , ( ).

. false.

, Object.defineProperty() Object.freeze().

js
"use strict";
var obj = Object.freeze({ name: "Elsa", score: 157 });
delete obj.score; // TypeError

("use strict");
var obj = {};
Object.defineProperty(obj, "foo", { value: 2, configurable: false });
delete obj.foo; // TypeError

("use strict");
var frozenArray = Object.freeze([0, 1, 2]);
frozenArray.pop(); // TypeError

JavaScript . , .

js
"use strict";
delete Math.PI; // TypeError


Web Proxy Viewer  |  New URL  |  Original Page