list_set(xs, i, v)
Assign the value v
to the i
th element of the list xs
, where
i >= 0 && i < length(xs)
. Raise an "argument" error
if xs
is not a list or i
is not a valid index. Return modified tail of the list.
let xs = [10, 20, 30]
list_set(xs, 1, 100)
xs
// [10, 100, 30]