@@ -242,6 +242,96 @@ array.Any("i => i.length > 2");
242242array .Any (" i => i == ''" );
243243```
244244
245+ ### All
246+
247+ Tests if all items in the array match the condition
248+
249+ ``` javascript
250+ var array = [" item1" , " item2" , " item3" , " item4" , " no" ];
251+
252+ // false
253+ array .All (" i => i.length > 2" );
254+ ```
255+
256+ ### Contains
257+
258+ Tests if array contains specific object
259+
260+ ``` javascript
261+ var array = [" item1" , " item2" , " item3" , " item4" , " no" ];
262+
263+ // false
264+ array .Contains (" test" );
265+ ```
266+
267+ ### Concat
268+
269+ Combines two arrays
270+
271+ ``` javascript
272+ var array = [" item1" , " item2" , " item3" ];
273+ var array2 = [" item4" , " no" ];
274+
275+ // ["item1", "item2", "item3", "item4", "no"]
276+ array .Concat (array2);
277+ ```
278+
279+ ### Join
280+
281+ Joins the entries by the given char
282+
283+ ``` javascript
284+ var array = [" item1" , " item2" , " item3" , " item4" , " no" ];
285+
286+ // item1-item2-item3-item4-no
287+ array .Join (" -" );
288+
289+ // item1-item2-item3-item4
290+ array .Join (" -" , " x => x.length > 2" );
291+ ```
292+
293+ ### Aggregate
294+
295+ Combines the entries by your definition
296+
297+ ``` javascript
298+ var array = [" item1" , " item2" , " item3" , " item4" , " no" ];
299+
300+ // no-item4-item3-item2-item1
301+ array .Aggregate (" (str, item) => item + '-' + item" );
302+ ```
303+
304+ ### Reverse
305+
306+ Reverses the array
307+
308+ ``` javascript
309+ var array = [" item1" , " item2" , " item3" , " item4" , " no" ];
310+
311+ // ["no", "item4", "item3", "item2", "item1"]
312+ array .Reverse ();
313+ ```
314+
315+ ### Average
316+
317+ Computes the average of the elements
318+
319+ ``` javascript
320+ var array = [{val: 5 }, {val: 3 }, {val: 1 }];
321+
322+ // 3
323+ array .Average (" x => x.val" );
324+
325+ // 4
326+ array .Average (" x => x.val" , " x => x.val > 1" );
327+
328+
329+ var array2 = [3 , 4 , 5 ];
330+
331+ // 4
332+ array2 .Average ();
333+ ```
334+
245335### First
246336
247337Returns the First item of the array and if a filter was set the first item that matches the filter - Throws an Exception if no item was found
0 commit comments