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
`seal` seals an object. Sealing an object prevents extensions and makes existing properties non-configurable. A sealed object has a fixed set of properties. Unlike `freeze`, values of existing properties can still be changed as long as they are writable.
54
+
55
+
**Note:** `seal` returns the same object that was passed in; it does not create a copy. Any attempt to delete or add properties to a sealed object will fail, either silently or by throwing an error.
56
+
57
+
See [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.seal) and [Object.seal on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal)
`freeze` freezes an object. Freezing an object makes existing properties non-writable and prevents extensions. Once an object is frozen, new properties cannot be be added, existing properties cannot be removed, and their values cannot be changed.
`isSealed` determines if an object is sealed. A sealed object has a fixed set of properties.
95
+
96
+
See [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.issealed) and [Object.isSealed on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed)
97
+
98
+
## Examples
99
+
100
+
```rescript
101
+
let point = {"x": 1, "y": 3}->Object.seal
102
+
let pointIsSealed = point->Object.isSealed // true
103
+
let fruit = {"name": "Apple" }
104
+
let fruitIsSealed = fruit->Object.isSealed // false
105
+
```
106
+
*/
107
+
@val
108
+
externalisSealed: 'a=>bool="Object.isSealed"
109
+
74
110
/**
75
111
`isFrozen` determines if an object is frozen. An object is frozen if an only if it is not extensible, all its properties are non-configurable, and all its data properties are non-writable.
0 commit comments