Arrays
57 entries. What each one takes, what it returns, and a working example.
A new array holding the given elements.
Builds an array by listing elements directly; mixed types are allowed, but numeric summaries (arraySum, arrayAvg) count only the numbers.
a = array(10, 20, 30) plot(arraySum(a))
10+20+30 = 60 (the array sum is plotted on every bar).
w = array(0.5, 0.3, 0.2) plot(arraySum(w))
A weight vector: 0.5+0.3+0.2 = 1.0 (an array can be built from float values).
A NEW array holding each element's absolute value (the original is unchanged).
Works element-wise; non-numeric elements are copied as-is. It does not mutate the original.
a = arrayFrom(-3, 4, -5) b = arrayAbs(a) plot(arraySum(b))
|−3|+|4|+|−5| = 12.
a = arrayFrom(-2, -4, -6) b = arrayAbs(a) plot(arrayMax(b))
The absolute values are 2,4,6 → the largest is 6 (the biggest magnitude).
Counts only numbers. On an empty or fully non-numeric array it returns na (not 0).
a = arrayFrom(10, 20, 30) plot(arrayAvg(a))
The mean: 20.
var w = arrayNew(0) arrayPush(w, close) if arraySize(w) > 10 { arrayShift(w) } plot(arrayAvg(w))
The average of the last 10 closes — an SMA(10) built by hand with an array.
arrayBinarySearch(dizi, değer)
The index of the value; -1 if not found.
Assumes the array is ASCENDING sorted; on an unsorted array the result is meaningless. Much faster than linear search (arrayIndexOf) on large arrays.
a = arrayFrom(10, 20, 30, 40) plot(arrayBinarySearch(a, 30))
The value 30 is at position 2.
a = arrayFrom(10, 20, 30, 40) plot(arrayBinarySearch(a, 25))
25 is not in the sorted array → -1 (binary search found nothing). The array must be sorted.
arrayBinarySearchLeftmost(dizi, değer)
The first position equal to the value; if absent, the position where it would be inserted (leftmost insertion point).
Gives the leftmost position where the value could go in a sorted array. If the value repeats it returns the first copy's index.
a = arrayFrom(1, 2, 2, 2, 3) plot(arrayBinarySearchLeftmost(a, 2))
The first 2 is at position 1.
a = arrayFrom(1, 3, 5) plot(arrayBinarySearchLeftmost(a, 4))
4 is not in the array; the (leftmost) position where it would be inserted is 2. Requires a sorted array.
arrayBinarySearchRightmost(dizi, değer)
The last position equal to the value; if absent, the position of the last element smaller than it (rightmost).
Gives the position of the value's last copy, or of the last element smaller than it, in a sorted array.
a = arrayFrom(1, 2, 2, 2, 3) plot(arrayBinarySearchRightmost(a, 2))
The last 2 is at position 3.
a = arrayFrom(1, 2, 3, 4) plot(arrayBinarySearchRightmost(a, 3))
3 occurs once → the rightmost match is that same position: 2. With duplicates it would give the rightmost one.
Deletes all elements, size becomes 0; the array itself (the reference) is kept.
a = arrayFrom(1, 2, 3) arrayClear(a) plot(arraySize(a))
Emptied → size 0.
var w = arrayNew(0) arrayPush(w, close) if arraySize(w) >= 10 { arrayClear(w) } plot(arraySize(w))
When the size reaches 10 the array is cleared → a 1..10 sawtooth (a periodic bucket).
The extended dizi1 (same reference).
Appends dizi2's elements to the end of dizi1 and mutates dizi1. dizi2 is left untouched.
a = arrayFrom(1, 2) b = arrayFrom(3, 4) arrayConcat(a, b) plot(arraySize(a))
dizi1 grew to 4 elements.
a = arrayFrom(1, 2) b = arrayFrom(3, 4, 5) arrayConcat(a, b) plot(arrayAvg(a))
The two arrays are merged (1,2,3,4,5) → average 3 (merge, then reduce).
Returns a shallow copy; mutating the copy does not affect the original. Used to preserve the original before in-place functions (arraySort, arrayReverse).
a = arrayFrom(3, 1, 2) b = arrayCopy(a) arraySort(b, true) plot(arrayFirst(a))
The copy is sorted; the original's first element is still 3.
a = arrayFrom(1, 2, 3) b = arrayCopy(a) arrayPush(b, 4) plot(arraySize(a))
An element is pushed to the copy but the original is untouched → the original size is still 3 (an independent copy).
arrayCovariance(dizi1, dizi2, biased?)
The covariance of the two arrays; na if fewer than 2 common numeric elements.
Measures the direction and strength with which two series move together. If the arrays differ in length they are paired up to the shorter one. The default divisor is biased (n).
a = arrayFrom(1, 2, 3) b = arrayFrom(2, 4, 6) plot(arrayCovariance(a, b))
Two arrays rising together → positive covariance (≈1.33, biased).
a = arrayFrom(1, 2, 3) b = arrayFrom(6, 4, 2) plot(arrayCovariance(a, b))
As one rises the other falls → negative covariance (≈ -1.33).
true if all elements are truthy/non-zero; false for an empty array.
Evaluates each element for truthiness: 0/na/false count as false. Returns false for an empty array.
a = arrayFrom(1, 1, 1) plot(arrayEvery(a) ? 1 : 0)
All elements are non-zero → true.
a = arrayFrom(1, 0, 1) plot(arrayEvery(a) ? 1 : 0)
One element is 0 → arrayEvery is false (0). Not all elements are non-zero.
arrayFill(dizi, değer, başla?, bitir?)
Returns nothing (na); it fills the array in place.
Writes the same value into every element of the range; it does not change the size. Fills the whole array if no range is given.
a = arrayNew(5, 0) arrayFill(a, 9, 1, 3) plot(arraySum(a))
Elements 1 and 2 set to 9 → sum is 18.
a = arrayNew(4, 1) arrayFill(a, 0) plot(arraySum(a))
With no range given the whole array is filled with 0 → sum 0 (a bulk reset).
The first element; na if the array is empty.
Same as arrayGet(array, 0) but reads clearer; it does not modify the array.
a = arrayFrom(11, 22, 33) plot(arrayFirst(a))
The first element: 11.
var w = arrayNew(0) arrayPush(w, close) if arraySize(w) > 5 { arrayShift(w) } plot(arrayFirst(w))
The first (oldest) element of a 5-bar rolling window — the close from 5 bars ago.
A new array made from the given values.
Does the same job as array; use whichever reads better to you.
a = arrayFrom(3, 1, 2) plot(arrayMax(a))
The largest value in the array: 3.
a = arrayFrom(5, 1, 9, 3, 7) plot(arrayMedian(a))
The input may be unordered: sorted it is 1,3,5,7,9 → the exact middle (median) is 5.
The element at i; returns na if the index is out of range (no error).
Negative index reaches from the end. An out-of-range index does not crash, it yields na — you can check the result with na().
a = arrayFrom(10, 20, 30) plot(arrayGet(a, -1))
The last element: 30.
a = arrayFrom(close, close[1], close[2]) plot(arrayGet(a, 0) > arrayGet(a, 2) ? 1 : 0)
Access by positive index: 1 if the current close (element 0) is above the close two bars ago (element 2).
true if the value is in the array, false otherwise.
Uses type-strict equality: numbers match numbers, text matches text, booleans match booleans.
a = arrayFrom(1, 2, 3) plot(arrayIncludes(a, 2) ? 1 : 0)
2 is in the array → true (plotted as 1).
a = arrayFrom(1, 5, 9) plot(arrayIncludes(a, 4) ? 1 : 0)
4 is not in the array → false (plotted as 0) — the negative case of a membership test.
The index of the first match; -1 if not found.
Scans from the front and returns the first match's position. Applies type-strict equality. To search from the end, use arrayLastIndexOf.
a = arrayFrom(5, 6, 7) plot(arrayIndexOf(a, 7))
The value 7 is at position 2.
a = arrayFrom(5, 6, 7) plot(arrayIndexOf(a, 99))
99 is not in the array → -1 (the not-found sentinel).
Returns nothing (na); it grows the array in place.
Inserts an element at the position; following elements shift right. If the position exceeds the size it goes to the end, if too small to the front.
a = arrayFrom(1, 3) arrayInsert(a, 1, 2) plot(arrayGet(a, 1))
2 inserted at position 1 → array is 1,2,3.
a = arrayFrom(1, 2, 3) arrayInsert(a, 0, 0) plot(arrayFirst(a))
0 is inserted at position 0 (the front) → the new first element is 0.
A single text of the elements joined by the separator.
Converts each element to text and joins with the separator. Uses a comma when none is given.
a = arrayFrom(1, 2, 3) s = arrayJoin(a, "-") plot(s == "1-2-3" ? 1 : 0)
Elements joined with "-" → "1-2-3".
a = arrayFrom(1, 2, 3) s = arrayJoin(a) plot(s == "1,2,3" ? 1 : 0)
With no separator given, the default is a comma → "1,2,3".
The last element; na if the array is empty.
Same as arrayGet(array, -1) but reads clearer; it does not modify the array.
a = arrayFrom(11, 22, 33) plot(arrayLast(a))
The last element: 33.
var w = arrayNew(0) arrayPush(w, high) plot(arrayLast(w))
high is pushed every bar; the last element is the most recently added (current) high.
The index of the last match; -1 if not found.
Scans from the end toward the front and returns the last match's position. Applies type-strict equality.
a = arrayFrom(5, 6, 5) plot(arrayLastIndexOf(a, 5))
The last 5 is at position 2.
a = arrayFrom(5, 6, 5) plot(arrayLastIndexOf(a, 9))
9 is not in the array at all → -1 (a last-index search also finds nothing).
The largest numeric element; na if there are none.
Compares only numbers; text/na are skipped.
a = arrayFrom(7, 3, 9) plot(arrayMax(a))
The maximum: 9.
var w = arrayNew(0) arrayPush(w, high) if arraySize(w) > 20 { arrayShift(w) } plot(arrayMax(w))
The highest high of the last 20 bars — a rolling resistance (Donchian upper band).
The median value; na if empty. For an even count it is the average of the middle two.
Sorts the values and takes the middle; it is less sensitive to outliers than the mean.
a = arrayFrom(1, 2, 3, 4) plot(arrayMedian(a))
Average of the middle two: (2+3)/2 = 2.5.
a = arrayFrom(5, 1, 9, 3, 7) plot(arrayMedian(a))
An odd number of elements: sorted 1,3,5,7,9 → the exact middle 5 (unlike the even-count case).
The smallest numeric element; na if there are none.
Compares only numbers; text/na are skipped.
a = arrayFrom(7, 3, 9) plot(arrayMin(a))
The minimum: 3.
var w = arrayNew(0) arrayPush(w, low) if arraySize(w) > 20 { arrayShift(w) } plot(arrayMin(w))
The lowest low of the last 20 bars — a rolling support (Donchian lower band).
The most frequent numeric value; the smallest on a tie; na if empty.
If several values share the top frequency it returns the smallest. Counts only numeric elements.
a = arrayFrom(2, 2, 1, 1) plot(arrayMode(a))
1 and 2 tie in frequency → the smaller: 1.
a = arrayFrom(1, 3, 3, 3, 2) plot(arrayMode(a))
The value 3 occurs three times → the most frequent (mode) is 3 (a clear winner).
A new array of size elements, each equal to the initial value.
Used to allocate a fixed-size array up front, then fill it with arraySet/arrayFill. Elements are 0 when no initial value is given.
a = arrayNew(4, 5) plot(arraySum(a))
All 4 elements are 5 → sum is 20.
a = arrayNew(3, 2) arrayPush(a, 4) plot(arrayAvg(a))
Three elements are built with 2, then a 4 is pushed → average (2+2+2+4)/4 = 2.5.
arrayNewBool(boyut, başlangıç?)
A new array of size elements, each equal to the initial value.
Behaves the same as arrayNew; signals a boolean array. Defaults to 0 (acts falsy) when no initial value is given.
a = arrayNewBool(3, true) plot(arrayEvery(a) ? 1 : 0)
All elements true → arrayEvery is true.
a = arrayNewBool(3, false) arraySet(a, 1, true) plot(arraySome(a) ? 1 : 0)
Three elements are built as false, then element 1 is set to true → arraySome is true (1).
arrayNewBox(boyut, başlangıç?)
A new box array of size elements.
Behaves the same as arrayNew; a type-specific constructor signaling intent to hold box. Elements are 0 if no initial value is given (usually filled by passing na/an initial).
a = arrayNewBox(2) plot(arraySize(a))
A 2-element array is allocated.
var kutular = arrayNewBox(0) plot(arraySize(kutular))
An empty (0-element) box-handle store kept with var — carried across bars, starting at size 0.
arrayNewColor(boyut, başlangıç?)
A new color array of size elements.
Behaves the same as arrayNew; a type-specific constructor signaling intent to hold color. Elements are 0 if no initial value is given (usually filled by passing na/an initial).
a = arrayNewColor(2) plot(arraySize(a))
A 2-element array is allocated.
var palet = arrayNewColor(2, "#26a69a") arraySet(palet, 1, "#ef5350") plot(arraySize(palet))
Two colors are allocated, element 1 is replaced with a sell color → a buy/sell palette, size 2.
arrayNewFloat(boyut, başlangıç?)
A new array of size numeric elements, each equal to the initial value.
Behaves the same as arrayNew; signals a numeric (float) array. Defaults to 0 when no initial value is given.
a = arrayNewFloat(3, 1.5) plot(arraySum(a))
All 3 elements are 1.5 → sum is 4.5.
a = arrayNewFloat(3, close) plot(arrayGet(a, 0))
Three elements are built with the current close → element 0 is that bar's close (the initial value can be a series).
arrayNewInt(boyut, başlangıç?)
A new array of size elements, each equal to the initial value.
Behaves the same as arrayNew; signals an integer array. Numeric storage is floating-point; using values as integers is up to you.
a = arrayNewInt(4, 2) plot(arraySum(a))
All 4 elements are 2 → sum is 8.
a = arrayNewInt(3, 10) arraySet(a, 0, 5) plot(arrayMin(a))
Three elements are built with 10, then element 0 is set to 5 → the minimum is 5.
arrayNewLabel(boyut, başlangıç?)
A new label array of size elements.
Behaves the same as arrayNew; a type-specific constructor signaling intent to hold label. Elements are 0 if no initial value is given (usually filled by passing na/an initial).
a = arrayNewLabel(2) plot(arraySize(a))
A 2-element array is allocated.
a = arrayNewLabel(3) arrayPop(a) plot(arraySize(a))
Three label slots are allocated, one is popped → size 2.
arrayNewLine(boyut, başlangıç?)
A new line array of size elements.
Behaves the same as arrayNew; a type-specific constructor signaling intent to hold line. Elements are 0 if no initial value is given (usually filled by passing na/an initial).
a = arrayNewLine(2) plot(arraySize(a))
A 2-element array is allocated.
a = arrayNewLine(4) arrayRemove(a, 0) plot(arraySize(a))
Four line slots are allocated, element 0 is removed → size 3.
arrayNewLinefill(boyut, başlangıç?)
A new line fill array of size elements.
Behaves the same as arrayNew; a type-specific constructor signaling intent to hold line fill. Elements are 0 if no initial value is given (usually filled by passing na/an initial).
a = arrayNewLinefill(2) plot(arraySize(a))
A 2-element array is allocated.
a = arrayNewLinefill(2) arrayClear(a) plot(arraySize(a))
Two linefill slots are allocated, then the array is cleared → size 0.
arrayNewString(boyut, başlangıç?)
A new array of size elements, each equal to the initial text.
Builds a text array. Unlike the other arrayNew families: when no initial value is given the element is EMPTY TEXT (""), not 0.
a = arrayNewString(2) plot(arrayGet(a, 0) == "" ? 1 : 0)
No initial value → elements are empty text.
a = arrayNewString(2, "AL") arraySet(a, 1, "SAT") plot(arrayIndexOf(a, "SAT"))
Two elements are built as "AL", then element 1 is set to "SAT" → "SAT" is at position 1.
arrayNewTable(boyut, başlangıç?)
A new table array of size elements.
Behaves the same as arrayNew; a type-specific constructor signaling intent to hold table. Elements are 0 if no initial value is given (usually filled by passing na/an initial).
a = arrayNewTable(2) plot(arraySize(a))
A 2-element array is allocated.
a = arrayNewTable(1) b = arrayNewTable(2) arrayConcat(a, b) plot(arraySize(a))
A 1-element and a 2-element table array are concatenated → size 3.
arrayPercentRank(dizi, indeks)
The 0–100 percentile rank of element i; na if the index is invalid/non-numeric; 0 with fewer than 2 numeric elements.
Tells what percentile the given element sits at relative to the array: how many elements are less than or equal to it. 0 = smallest, 100 = largest.
a = arrayFrom(10, 20, 30, 40, 50) plot(arrayPercentRank(a, 2))
The value 30 sits at the 50th percentile of the array.
a = arrayFrom(10, 20, 30, 40, 50) plot(arrayPercentRank(a, 4))
The largest element (50, index 4) sits at the 100th percentile of the array.
arrayPercentileLinearInterpolation(dizi, yüzde)
The linearly interpolated percentile value; na if empty.
Finds the position among sorted values by linear interpolation; the result may not be an actual array element. Gives a smoother/continuous percentile.
a = arrayFrom(1, 2, 3, 4) plot(arrayPercentileLinearInterpolation(a, 50))
The 50th percentile (median) = 2.5.
a = arrayFrom(1, 2, 3, 4) plot(arrayPercentileLinearInterpolation(a, 25))
The 25th percentile with linear interpolation = 1.75 (a slice other than the median).
arrayPercentileNearestRank(dizi, yüzde)
The percentile value by the nearest-rank method; na if empty.
Rounds the rank matching the percentile up and returns the ACTUAL element at that position; it does not produce interpolated values.
a = arrayFrom(1, 2, 3, 4) plot(arrayPercentileNearestRank(a, 50))
The 50th nearest-rank → actual array value 2.
a = arrayFrom(10, 20, 30, 40, 50) plot(arrayPercentileNearestRank(a, 90))
The 90th percentile by nearest rank → the real value at the top end, 50.
The removed last element; na if the array is empty.
Shortens the array by one element and returns the removed value. On an empty array it does not crash, it returns na.
a = arrayFrom(1, 2, 3) x = arrayPop(a) plot(x)
The last element is removed and returned: 3.
a = arrayFrom(1, 2, 3, 4) arrayPop(a) arrayPop(a) plot(arrayLast(a))
The last element is popped twice (4, then 3) → the remaining last element is 2 (LIFO).
The new element count after the append.
Grows the array by one element. The core tool for continuous accumulation (a log, a results list).
a = arrayNew(0) arrayPush(a, close) plot(arraySize(a))
close is appended each bar; the size grows with the bar count.
var sinyaller = arrayNew(0) if crossover(close, sma(close, 20)) { arrayPush(sinyaller, close) } plot(arraySize(sinyaller))
close is pushed only on an up-cross of the 20-SMA; the size is the number of signals so far.
The difference between the largest and smallest numeric element (max - min); na if empty.
The simplest spread measure; very sensitive to a single outlier.
a = arrayFrom(3, 7, 1) plot(arrayRange(a))
7 - 1 = 6.
a = arrayFrom(-5, 0, 5, 10) plot(arrayRange(a))
Max - min = 10 - (-5) = 15 (works with negative values too).
The removed element; na if the index is out of range.
Removes the element at the position, shifts the rest left, and returns the removed value.
a = arrayFrom(5, 6, 7) x = arrayRemove(a, 1) plot(x)
Element 1 is removed and returned: 6.
a = arrayFrom(5, 6, 7) arrayRemove(a, 0) plot(arrayFirst(a))
Element 0 (5) is removed and the rest shift down → the new first element is 6.
Returns nothing (na); it reverses the array order in place.
Flips the element order front-to-back; it mutates the array.
a = arrayFrom(1, 2, 3) arrayReverse(a) plot(arrayFirst(a))
Order reversed → the first element is now 3.
a = arrayFrom(1, 2, 3, 4) arrayReverse(a) plot(arrayLast(a))
The order is reversed → the last element is now the original first, 1.
Returns nothing (na); it modifies the array in place.
Overwrites an existing position; it does not grow the array. If the index is out of range it silently does nothing.
a = arrayNew(3, 0) arraySet(a, 1, 9) plot(arraySum(a))
Element 1 set to 9, others 0 → sum is 9.
a = arrayNew(3, 0) arraySet(a, 0, high) arraySet(a, 2, low) plot(arrayGet(a, 0) - arrayGet(a, 2))
high is written to element 0 and low to element 2; their difference is the bar's range (high - low).
The removed first element; na if the array is empty.
Removes from the front and shifts the rest forward. Used in queue (FIFO) fashion.
a = arrayFrom(1, 2, 3) x = arrayShift(a) plot(x)
The first element is removed and returned: 1.
a = arrayFrom(10, 20, 30) arrayShift(a) plot(arrayFirst(a))
One element is dropped from the front (10) → the new first element is 20.
Returns 0 for an empty array. Used for loop bounds and emptiness checks.
a = arrayFrom(5, 6, 7) plot(arraySize(a))
3 elements.
var w = arrayNew(0) arrayPush(w, close) if arraySize(w) > 20 { arrayShift(w) } plot(arraySize(w) == 20 ? 1 : 0)
1 once the 20-bar rolling window is full (ready), 0 for the first 20 bars — a warmup gate.
arraySlice(dizi, başla, bitir?)
A new copy array of the start..end range.
Does NOT modify the source; returns an independent sub-array copy. end is exclusive.
a = arrayFrom(0, 1, 2, 3, 4) b = arraySlice(a, 1, 3) plot(arraySize(b))
Elements 1 and 2 → a 2-element copy.
a = arrayFrom(1, 2, 3, 4, 5) b = arraySlice(a, 2) plot(arraySum(b))
From element 2 to the end (no end given) → 3,4,5; sum 12.
true if at least one element is truthy/non-zero; false if none is (or if empty).
Evaluates each element for truthiness; becomes true at the first truthy element. false for an empty array.
a = arrayFrom(0, 0, 1) plot(arraySome(a) ? 1 : 0)
One element is non-zero → true.
a = arrayFrom(0, 0, 0) plot(arraySome(a) ? 1 : 0)
All elements are 0 → arraySome is false (0). There is no non-zero element.
Returns nothing (na); it sorts the array in place.
Sorts only numeric elements; non-numeric ones go to the end in their original order. It mutates the array — use arrayCopy first if you need a copy.
a = arrayFrom(30, 10, 20) arraySort(a, true) plot(arrayFirst(a))
Sorted ascending → the first element is the smallest: 10.
a = arrayFrom(30, 10, 20, 40) arraySort(a, false) plot(arrayFirst(a))
Descending sort (second argument false) → the first element is the largest: 40.
arraySortIndices(dizi, artan?)
An array of indices that would sort the array; the array itself is unchanged.
Without mutating the array, gives the element positions that put it in order. Only numeric elements enter the ordering. Ideal for picking the best/worst N.
a = arrayFrom(30, 10, 20) b = arraySortIndices(a, true) plot(arrayGet(b, 0))
The smallest value (10) is at position 1 → first index is 1.
a = arrayFrom(30, 10, 20) b = arraySortIndices(a, false) plot(arrayGet(b, 0))
In descending order the largest value (30) is at position 0 → the first index is 0. The array itself is unchanged.
A NEW array converting each element to its z-score (x−mean)/std; all zeros if the deviation is 0 or there are fewer than 2 elements.
Rescales values to mean 0 and standard deviation 1 (using sample std). It does not mutate the original.
a = arrayFrom(1, 2, 3) b = arrayStandardize(a) plot(arrayGet(b, 2))
The largest element is +1 std from the mean → 1.
a = arrayFrom(10, 20, 30, 40, 50) b = arrayStandardize(a) plot(arrayGet(b, 0))
The first element (10, the smallest) is about 1.26 standard deviations below the mean → its z-score ≈ -1.26.
The sample standard deviation (square root of variance); na with fewer than 2 numeric elements.
Gives spread in the same unit as the values; the square root of arrayVariance.
a = arrayFrom(2, 4, 4, 4, 5, 5, 7, 9) plot(arrayStdev(a))
The sample standard deviation ≈ 2.14.
var w = arrayNew(0) arrayPush(w, close) if arraySize(w) > 20 { arrayShift(w) } plot(arrayStdev(w))
The standard deviation of the last 20 closes — a rolling volatility measure.
The sum of numeric elements; 0 if there are no numeric elements.
Sums only numbers; it skips text/na elements. Yields 0 for an empty array.
a = arrayFrom(10, 20, 30) plot(arraySum(a))
The sum: 60.
a = arrayFrom(close > open ? 1 : 0, close[1] > open[1] ? 1 : 0, close[2] > open[2] ? 1 : 0) plot(arraySum(a))
Counts how many of the last 3 bars had close>open (0 to 3).
The new element count after the prepend.
Grows the array at the front; existing elements shift one position to the right.
a = arrayFrom(2, 3) arrayUnshift(a, 1) plot(arrayFirst(a))
The new first element: 1.
a = arrayFrom(3) arrayUnshift(a, 2) arrayUnshift(a, 1) plot(arrayGet(a, 0))
2 then 1 are prepended → the array is 1,2,3; the first element is 1.
The sample variance (divided by n-1); na with fewer than 2 numeric elements.
Measures the spread of the distribution; uses the n-1 (sample) divisor. Its square root is arrayStdev.
a = arrayFrom(2, 4, 6) plot(arrayVariance(a))
The sample variance: 4.
a = arrayFrom(10, 10, 10, 10) plot(arrayVariance(a))
All elements equal → no dispersion → variance 0.
A text array holding the parts.
Splits the text at the separator into an array. Uses a comma when none is given; an empty separator splits into characters.
a = split("AL,SAT,BEKLE", ",") plot(arraySize(a))
Split into 3 parts.
p = split("AL,SAT,BEKLE", ",") plot(arrayIndexOf(p, "SAT"))
The text is split on commas; among the parts "SAT" is at position 1 (parse, then find).