View source

class thx.ArrayInts

import thx.Arrays;

Available on all platforms

Helper class for Array<Int>.

Class Fields

static function average(arr:ReadonlyArray<Int>):Null<Float>

Finds the average of all the elements in the array.

static function max(arr:ReadonlyArray<Int>):Null<Int>

Finds the max int element in the array.

static function min(arr:ReadonlyArray<Int>):Null<Int>

Finds the min int element in the array.

static function resize(array:Array<Int>, length:Int, fill:Int = 0):Array<Int>

Resizes an array of Int to an arbitrary length by adding more elements (default is 0) to its end or by removing extra elements.

Note that the function changes the passed array and doesn't create a copy.

static function sum(arr:ReadonlyArray<Int>):Null<Int>

Finds the sum of all the elements in the array.

Toggle inherited fields