You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
user.name="Pete"; // Error: Cannot assign to read only property 'name'...
119
+
user.name="Pete"; // Error: Cannot assign to read only property 'name'
120
120
*/!*
121
121
```
122
122
123
123
Now no one can change the name of our user, unless they apply their own `defineProperty` to override ours.
124
124
125
125
```smart header="Errors appear only in strict mode"
126
-
In the non-strict mode, no errors occur when writing to non-writable properties and such. But the operation still won't succeed. Flag-violating actions are just silently ignored in non-strict.
126
+
In non-strict mode, no errors occur when writing to non-writable properties and such. But the operation still won't succeed. Flag-violating actions are just silently ignored in non-strict.
127
127
```
128
128
129
129
Here's the same example, but the property is created from scratch:
0 commit comments