@@ -3,8 +3,8 @@ title: "Dict"
33slug : " dict"
44description : " "
55summary : " "
6- date : 2025-12-01T15:11:30 +02:00
7- lastmod : 2025-12-01T15:11:30 +02:00
6+ date : 2025-12-02T17:44:19 +02:00
7+ lastmod : 2025-12-02T17:44:19 +02:00
88draft : false
99weight : 410
1010toc : true
@@ -75,6 +75,45 @@ Adds or replaces an entry to a dictionary, given a (key, value) pair
7575(print data) # {key: hole, hello: world}
7676{{< /highlight_arkscript >}}
7777
78+ ## contains?
79+
80+ ---
81+ ` (let contains? (fun (_D _key) (...))) `
82+ Checks if the dictionary has a given key
83+
84+ #### Parameter
85+ - ` _D ` : dictionary
86+
87+ #### Author
88+ [ @SuperFola ] ( https://github.com/SuperFola )
89+
90+ #### Example
91+ {{< highlight_arkscript >}}
92+ (let data (dict "key" "value"))
93+ (print (dict: contains ? data "key")) # true
94+ (print (dict: contains ? data "test")) # false
95+ {{< /highlight_arkscript >}}
96+
97+ ## contains
98+
99+ ---
100+ ` (let contains <value>) `
101+ Checks if the dictionary has a given key
102+
103+ ** Note** : ** Deprecated, use ` contains? ` **
104+ #### Parameter
105+ - ` _D ` : dictionary
106+
107+ #### Author
108+ [ @SuperFola ] ( https://github.com/SuperFola )
109+
110+ #### Example
111+ {{< highlight_arkscript >}}
112+ (let data (dict "key" "value"))
113+ (print (dict: contains data "key")) # true
114+ (print (dict: contains data "test")) # false
115+ {{< /highlight_arkscript >}}
116+
78117## getOrElse
79118
80119---
@@ -118,25 +157,6 @@ Updates an entry or create it from a default value
118157(dict: updateOrDefault data "count" (fun (c) (+ c 1)) 1) # count = 1
119158{{< /highlight_arkscript >}}
120159
121- ## contains
122-
123- ---
124- ` (let contains (fun (_D _key) (...))) `
125- Checks if the dictionary has a given key
126-
127- #### Parameter
128- - ` _D ` : dictionary
129-
130- #### Author
131- [ @SuperFola ] ( https://github.com/SuperFola )
132-
133- #### Example
134- {{< highlight_arkscript >}}
135- (let data (dict "key" "value"))
136- (print (dict: contains data "key")) # true
137- (print (dict: contains data "test")) # false
138- {{< /highlight_arkscript >}}
139-
140160## remove
141161
142162---
0 commit comments