You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `sort` method on a list returns the reversed list.
175
+
176
+
Syntax:
177
+
178
+
```javascript
179
+
e.sort()
180
+
181
+
// Where:
182
+
// `e` is a list .
183
+
```
184
+
185
+
Examples:
186
+
187
+
```javascript
188
+
[3, 2, 1].sort() // [1, 2, 3]
189
+
['c', 'b', 'a'].sort() // ['a', 'b', 'c']
190
+
```
191
+
192
+
### .uniq
193
+
194
+
The `uniq` method on a list returns a list of the unique elements.
195
+
196
+
Syntax:
197
+
198
+
```javascript
199
+
e.uniq()
200
+
201
+
// Where:
202
+
// `e` is a list .
203
+
```
204
+
205
+
Examples:
206
+
207
+
```javascript
208
+
[1,2,3,3,3,].uniq().sum() // 10
209
+
["a", "b", "b"].uniq().join() // "ab"
210
+
```
211
+
212
+
### .values
213
+
214
+
The `values` method on a map returns a list of values.
215
+
216
+
Syntax:
217
+
218
+
```javascript
219
+
e.values()
220
+
221
+
// Where:
222
+
// `e` is a map .
223
+
```
224
+
225
+
Examples:
226
+
227
+
```javascript
228
+
{'a': 1, 'b': 2}.values().sum() // 3
229
+
```
230
+
113
231
### all
114
232
115
233
The `all` macro tests whether a predicate holds for **all** elements of a list `e` or keys of a map `e`. It returns a boolean value based on the evaluation.
0 commit comments