array_ref_set


array_ref_set(arr, i, obj)
      

Set the element at the (zero-based) index i of the array arr to the object obj. Return void.

The index argument can also be a list of integers that indicates the position inside a multi-dimensional array.

Examples:


let a = make_array([2, 3])
a
// #[#[false, false, false], #[false, false, false]]
array_ref_set(a, [1, 2], "hello")
array_ref(a, [1, 2])
// hello

a[1][2]
// hello
a[0][1] = 100
a
// #[#[false, 100, false], #[false, false, "hello"]]
      

Also see:

array_ref
array_set


Core Module Index | Contents