Skip to content

Commit d7601b9

Browse files
committed
docs for Object.empty
1 parent 6539e1b commit d7601b9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/Core__Object.res

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
@obj external empty: unit => {..} = ""
1+
/**
2+
`empty` create a new object that inherits the properties and methods from the standard built-in Object, such as `toString`. See [Object on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
3+
4+
## Examples
5+
6+
```rescript
7+
let x = Object.empty()
8+
x->Object.keysToArray->Array.length // 0
9+
x->Object.get("toString")->Option.isSome // true
10+
```
11+
*/
12+
@obj
13+
external empty: unit => {..} = ""
214

315
/**
416
`is` determines if two objects are identical in all contexts. Objects, arrays, records, and other non-primitives are only identical if they reference the **exact** same object in memory. Primitives like ints, floats, and strings are identical if they have the same value. `+0` and `-0` are distinct. NaN is equal to itself. See [Object.is on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)

0 commit comments

Comments
 (0)