array_shrink


array_shrink(arr, n)
      

Reduce the size of the array arr to n. Raise an "Out of range" error if n is not in 0 ≤ n ≤ array_length(arr). Return void.

Examples:


let a = #[10, 20, 30]
array_shrink(a, 1) 
a
// #[10]
      

Also see:

subarray
array_copy


Core Module Index | Contents