diff --git a/1-js/07-object-properties/01-property-descriptors/article.md b/1-js/07-object-properties/01-property-descriptors/article.md index 7768b355..c977e62f 100644 --- a/1-js/07-object-properties/01-property-descriptors/article.md +++ b/1-js/07-object-properties/01-property-descriptors/article.md @@ -122,6 +122,10 @@ user.name = "Pete"; // Error: Cannot assign to read only property 'name'... Now no one can change the name of our user, unless they apply their own `defineProperty` to override ours. +```smart header="Errors appear only in use strict" +In the non-strict mode, no errors occur when writing to read-only properties and such. But the operation still won't succeed. Flag-violating actions are just silently ignored in non-strict. +``` + Here's the same operation, but for the case when a property doesn't exist: ```js run @@ -239,10 +243,6 @@ Object.defineProperty(user, "name", {writable: true}); // Error */!* ``` -```smart header="Errors appear only in use strict" -In the non-strict mode, no errors occur when writing to read-only properties and such. But the operation still won't succeed. Flag-violating actions are just silently ignored in non-strict. -``` - ## Object.defineProperties There's a method [Object.defineProperties(obj, descriptors)](mdn:js/Object/defineProperties) that allows to define many properties at once.