This language bar is your friend. Select your favorite languages!

Idiom #171 Add an element at the end of a list

Append element x to the list s.

classes
var
  L: TList;
  Item: Pointer;
...
  L.Add(Item);
...
s ~= x;
s = append(s, x)
$s[]=$x;
s.append(x)
s.push(x)

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

programming-idioms

Related idioms