ARRAY::FILL 1g 2023-12-06 laplante@plcb.ca GOWEB/ARRAY — Fill Array with a Value


title: “ARRAY::FILL” version: “1g” date: 2023-12-06 author: “laplante@plcb.ca”

category: “GOWEB/ARRAY”

Name

array::fill Fill Array with a Value

Synopsis

array::fill(variable, value[, deep: bool])

Description

The fill function replaces all elements in an array with the specified value.


Examples

res={{
    a := [1,2,3];
    fill(a, null);
    a;

    a = [ [1,2], [3,4], [5,6] ];
    fill(a, "A");
    a;

    a = [ [1,2], [3,4], [5,6] ];
    fill(a, deep:false, "A");
    a;
}}.

Returns:

[null,null,null]
[["A","A"],["A","A"],["A","A"]]
["A","A","A"]

Author

laplante@plcb.ca


See Also


Version