@@ -53,6 +53,7 @@ type key = string
5353## Examples
5454
5555```rescript
56+ let ages = dict{"Maria": 30, "Vinh": 22, "Fred": 49}
5657Js.Dict.get(ages, "Vinh") == Some(22)
5758Js.Dict.get(ages, "Paul") == None
5859```
@@ -66,6 +67,7 @@ let get: (t<'a>, key) => option<'a>
6667## Examples
6768
6869```rescript
70+ let ages = dict{"Maria": 30, "Vinh": 22, "Fred": 49}
6971Js.Dict.unsafeGet(ages, "Fred") == 49
7072Js.Dict.unsafeGet(ages, "Paul") // returns undefined
7173```
@@ -82,6 +84,7 @@ the key does not exist, and entry will be created for it.
8284## Examples
8385
8486```rescript
87+ let ages = dict{"Maria": 30, "Vinh": 22, "Fred": 49}
8588Js.Dict.set(ages, "Maria", 31)
8689Js.log(ages == Js.Dict.fromList(list{("Maria", 31), ("Vinh", 22), ("Fred", 49)}))
8790
@@ -98,6 +101,7 @@ Returns all the keys in the dictionary `dict`.
98101## Examples
99102
100103```rescript
104+ let ages = dict{"Maria": 30, "Vinh": 22, "Fred": 49}
101105Js.Dict.keys(ages) == ["Maria", "Vinh", "Fred"]
102106```
103107*/
@@ -115,6 +119,7 @@ Returns an array of key/value pairs in the given dictionary (ES2017).
115119## Examples
116120
117121```rescript
122+ let ages = dict{"Maria": 30, "Vinh": 22, "Fred": 49}
118123Js.Dict.entries(ages) == [("Maria", 30), ("Vinh", 22), ("Fred", 49)]
119124```
120125*/
@@ -126,6 +131,7 @@ Returns the values in the given dictionary (ES2017).
126131## Examples
127132
128133```rescript
134+ let ages = dict{"Maria": 30, "Vinh": 22, "Fred": 49}
129135Js.Dict.values(ages) == [30, 22, 49]
130136```
131137*/
0 commit comments