@@ -19,15 +19,15 @@ Integer literals may contain digit separators to allow digit grouping into more
1919
2020Example:
2121
22- ```
22+ ``` js
232310_000_000_000
2424```
2525
2626## Fields
2727
2828Struct fields and map elements can be accessed by using the ` . ` or the ` [] ` syntax.
2929
30- ```
30+ ``` js
3131foo .Field
3232bar[" some-key" ]
3333```
@@ -36,7 +36,7 @@ bar["some-key"]
3636
3737Functions may be called using the ` () ` syntax.
3838
39- ```
39+ ``` js
4040foo .Method ()
4141```
4242
@@ -53,7 +53,7 @@ foo.Method()
5353
5454Example:
5555
56- ```
56+ ``` js
5757x^ 2 + y^ 2
5858```
5959
@@ -74,7 +74,7 @@ x^2 + y^2
7474
7575Example:
7676
77- ```
77+ ``` js
7878life < universe || life < everything
7979```
8080
@@ -88,7 +88,7 @@ life < universe || life < everything
8888
8989Example:
9090
91- ```
91+ ``` js
9292" hello" matches " h.*"
9393```
9494
@@ -99,11 +99,11 @@ Example:
9999
100100Example:
101101
102- ```
102+ ``` js
103103user .Group in [" human_resources" , " marketing" ]
104104```
105105
106- ```
106+ ``` js
107107" foo" in {foo: 1 , bar: 2 }
108108```
109109
@@ -113,13 +113,13 @@ user.Group in ["human_resources", "marketing"]
113113
114114Example:
115115
116- ```
116+ ``` js
117117user .Age in 18..45
118118```
119119
120120The range is inclusive:
121121
122- ```
122+ ``` js
1231231..3 == [1 , 2 , 3 ]
124124```
125125
@@ -129,7 +129,7 @@ The range is inclusive:
129129
130130Example:
131131
132- ```
132+ ``` js
133133user .Age > 30 ? " mature" : " immature"
134134```
135135
@@ -157,7 +157,7 @@ user.Age > 30 ? "mature" : "immature"
157157
158158Returns ** true** if all elements satisfies the predicate (or if the array is empty).
159159
160- ```
160+ ``` js
161161all (Tweets, {.Size < 280 })
162162```
163163
@@ -170,7 +170,7 @@ Returns **true** if any elements satisfies the predicate. If the array is empty,
170170
171171Returns ** true** if _ exactly one_ element satisfies the predicate. If the array is empty, returns ** false** .
172172
173- ```
173+ ``` js
174174one (Participants, {.Winner })
175175```
176176
@@ -194,7 +194,7 @@ Returns new array by filtering elements of the array by predicate.
194194
195195Returns the number of elements what satisfies the predicate. Equivalent to:
196196
197- ```
197+ ``` js
198198len (filter (array, predicate))
199199```
200200
@@ -203,14 +203,14 @@ len(filter(array, predicate))
203203The closure is an expression that accepts a single argument. To access
204204the argument use the ` # ` symbol.
205205
206- ```
206+ ``` js
207207map (0..9 , {# / 2 })
208208```
209209
210210If the item of array is struct, it is possible to access fields of struct with
211211omitted ` # ` symbol (` #.Value ` becomes ` .Value ` ).
212212
213- ```
213+ ``` js
214214filter (Tweets, {len (.Value ) > 280 })
215215```
216216
@@ -224,7 +224,7 @@ Example:
224224
225225Variable ` array ` is ` [1,2,3,4,5] ` .
226226
227- ```
227+ ``` js
228228array[1 : 4 ] == [2 ,3 ,4 ]
229229array[: 3 ] == [1 ,2 ,3 ]
230230array[3 : ] == [4 ,5 ]
0 commit comments