Set all the elements in the array x to the same value v
my @x = (undef) x $n; foreach (@x) { $_ = $v }
my @x = ($v) x $n;
#include <array>
x.fill(v);
x = v
for i := range x { x[i] = v }
func fill[T any](x []T, v T) { for i := range x { x[i] = v } }
for i := Low(x) to High(x) do x[i] := v;
set_all_elements_to_same_value(X, V) :- length(X, Length), length(FilledList, Length), maplist(=(V), FilledList, X).
x[:] = [v] * len(x)
x.fill(v)
No security, no password. Other people might choose the same nickname.