types.Array.replace
Deprecated alias of replace_with.
The binding carries no declaration string, so the VM cannot report parameter names. The names above are from this page; the types and attributes still come from the VM. The VM also cannot tell an optional parameter from a variadic tail here, so read the brackets and any trailing
... from the prose below, not from the signature.Parameters
other | array | the array to copy elements from |
Return value
This array.
Notes
replace and replace_with are the exact same native function registered under two names; use replace_with, the newer name, in new code.
Example
// replace is a deprecated alias; replace_with is the same function under a new name
let a = [1, 2, 3];
let same = a.replace([7, 8]);
println("same == a:", same == a);
println("a =", ", ".join(a.map(@(v) v.tostring())));Output:
same == a: true
a = 7, 8See also
replace_with | Overwrites this array's elements with other's. |
| array | class index |