File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 18
18
@set_index external set : ({.. }, string , 'a ) => unit = ""
19
19
@set_index external setSymbol : ({.. }, Core__Symbol .t , 'a ) => unit = ""
20
20
21
- @val external keysToArray : {.. } => array <string > = "Object.keys"
21
+ /**
22
+ `keysToArray` returns an array of an object's own enumerable string-keyed property names.
23
+
24
+ ## Examples
25
+
26
+ ```rescript
27
+ {"a": 1, "b": 2}->Object.keysToArray // ["a", "b"]
28
+ {"a": undefined}->Object.keysToArray // ["a"]
29
+ Object.empty()->Object.keysToArray // []
30
+ ```
31
+ ## Specifications
32
+ - [ECMAScript Language Specification](https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.keys)
33
+ - [Object.keys on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys)
34
+ */
35
+ @val
36
+ external keysToArray : {.. } => array <string > = "Object.keys"
22
37
23
38
@val external hasOwnProperty : ({.. }, string ) => bool = "Object.prototype.hasOwnProperty.call"
24
39
You can’t perform that action at this time.
0 commit comments