Bentrix Docs
HomePricingDashboard

Assay reference: array

runs as written · runs with Bentrix's own convention, said in its note · refused by name, the note says what Bentrix lacks · not yet built.

Functions

array.abs#

runs
array.abs(id: arr) → arrsame

A new array of absolute values

idarrrequired

array.avg#

runs
array.avg(id: arr) → float

The mean

idarrrequired

array.binary_search_leftmost#

runs
array.binary_search_leftmost(id: arr, val: num) → int

The index of the value, or of the element before where it would stand

idarrrequired
valnumrequired

array.binary_search_rightmost#

runs
array.binary_search_rightmost(id: arr, val: num) → int

The index of the value, or of the element after where it would stand

idarrrequired
valnumrequired

array.clear#

runs
array.clear(id: arr)

Removes every element

idarrrequired

array.concat#

runs
array.concat(id1: arr, id2: arr) → arrsame

Appends the second to the first and answers the first

id1arrrequired
id2arrrequired

array.copy#

runs
array.copy(id: arr) → arrsame

A shallow copy

idarrrequired

array.covariance#

runs — Bentrix's own convention
array.covariance(id1: arr, id2: arr, biased: bool?) → float

The population covariance; the sample form where biased is false

id1arrrequired
id2arrrequired
biasedbooloptional

array.every#

runs
array.every(id: arr) → bool

Whether every element is true

idarrrequired

array.fill#

runs
array.fill(id: arr, value: elem, index_from: int?, index_to: int?)

Sets every element in the range

idarrrequired
valueelemrequired
index_fromintoptional
index_tointoptional

array.first#

runs
array.first(id: arr) → elem

The first element

idarrrequired

array.from#

runs
array.from(arg0: T, args: T...) → arr<T>

An array of the arguments

arg0Trequired
argsT...required

array.get#

runs
array.get(id: arr, index: int) → elem

The element at an index; a negative index counts from the end

idarrrequired
indexintrequired

array.includes#

runs
array.includes(id: arr, value: elem) → bool

Whether an element equals the value

idarrrequired
valueelemrequired

array.indexof#

runs
array.indexof(id: arr, value: elem) → int

The first index of the value, or -1

idarrrequired
valueelemrequired

array.insert#

runs
array.insert(id: arr, index: int, value: elem)

Inserts at an index

idarrrequired
indexintrequired
valueelemrequired

array.join#

runs
array.join(id: arr, separator: string?) → string

The elements as text, joined

idarrrequired
separatorstringoptional

array.last#

runs
array.last(id: arr) → elem

The last element

idarrrequired

array.lastindexof#

runs
array.lastindexof(id: arr, value: elem) → int

The last index of the value, or -1

idarrrequired
valueelemrequired

array.max#

runs
array.max(id: arr, nth: int?) → elem

The greatest, or the nth greatest

idarrrequired
nthintoptional

array.median#

runs
array.median(id: arr) → float

The middle value

idarrrequired

array.min#

runs
array.min(id: arr, nth: int?) → elem

The least, or the nth least

idarrrequired
nthintoptional

array.mode#

runs
array.mode(id: arr) → elem

The most frequent element, the smallest of several; na is not counted

idarrrequired

array.new#

runs
array.new(size: int?, initial_value: any?) → arr<G>

A new array of the generic type

sizeintoptional
initial_valueanyoptional

array.new_bool#

runs
array.new_bool(size: int?, initial_value: bool?) → arr<bool>

A new array of bools

sizeintoptional
initial_valuebooloptional

array.new_color#

runs
array.new_color(size: int?, initial_value: color?) → arr<color>

A new array of colours

sizeintoptional
initial_valuecoloroptional

array.new_float#

runs
array.new_float(size: int?, initial_value: num?) → arr<float>

A new array of floats

sizeintoptional
initial_valuenumoptional

array.new_int#

runs
array.new_int(size: int?, initial_value: int?) → arr<int>

A new array of ints

sizeintoptional
initial_valueintoptional

array.new_string#

runs
array.new_string(size: int?, initial_value: string?) → arr<string>

A new array of strings

sizeintoptional
initial_valuestringoptional

array.percentile_linear_interpolation#

runs — Bentrix's own convention
array.percentile_linear_interpolation(id: arr, percentage: num) → float

The percentile at p/100 × (n - 1) between its two neighbours

idarrrequired
percentagenumrequired

array.percentile_nearest_rank#

runs
array.percentile_nearest_rank(id: arr, percentage: num) → float

The value at rank ceil (p/100 × n)

idarrrequired
percentagenumrequired

array.percentrank#

runs — Bentrix's own convention
array.percentrank(id: arr, index: int) → float

The percentage of the other elements not above the indexed one

idarrrequired
indexintrequired

array.pop#

runs
array.pop(id: arr) → elem

Removes and answers the last

idarrrequired

array.push#

runs
array.push(id: arr, value: elem)

Appends

idarrrequired
valueelemrequired

array.range#

runs
array.range(id: arr) → float

The greatest minus the least

idarrrequired

array.remove#

runs
array.remove(id: arr, index: int) → elem

Removes and answers the element at an index

idarrrequired
indexintrequired

array.reverse#

runs
array.reverse(id: arr)

Reverses in place

idarrrequired

array.set#

runs
array.set(id: arr, index: int, value: elem)

Replaces the element at an index

idarrrequired
indexintrequired
valueelemrequired

array.shift#

runs
array.shift(id: arr) → elem

Removes and answers the first

idarrrequired

array.size#

runs
array.size(id: arr) → int

The count of elements

idarrrequired

array.slice#

runs — Bentrix's own convention
array.slice(id: arr, index_from: int, index_to: int) → arrsame

A COPY of the elements from index_from up to index_to

idarrrequired
index_fromintrequired
index_tointrequired

array.some#

runs
array.some(id: arr) → bool

Whether an element is true

idarrrequired

array.sort#

runs
array.sort(id: arr, order: any?)

Sorts in place, ascending unless order.descending

idarrrequired
orderanyoptional

array.sort_indices#

runs
array.sort_indices(id: arr, order: any?) → arr<int>

The indices that would sort it

idarrrequired
orderanyoptional

array.standardize#

runs — Bentrix's own convention
array.standardize(id: arr) → arr<float>

Each element less the mean, over the population standard deviation

idarrrequired

array.stdev#

runs — Bentrix's own convention
array.stdev(id: arr, biased: bool?) → float

The population standard deviation by two passes; the sample form where biased is false

idarrrequired
biasedbooloptional

array.sum#

runs
array.sum(id: arr) → float

The sum

idarrrequired

array.unshift#

runs
array.unshift(id: arr, value: elem)

Inserts at the front

idarrrequired
valueelemrequired

array.variance#

runs — Bentrix's own convention
array.variance(id: arr, biased: bool?) → float

The population variance by two passes; the sample form where biased is false

idarrrequired
biasedbooloptional

Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed