Logo

Programming-Idioms

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

Idiom #226 Delete last element from list

Remove the last element from the list items.

items.pop();

This truncates items in-place.

Ignore the returned value (which is the just removed value).

If items is already an empty list, it will remain empty.
with Ada.Containers.Vectors;
Items.Delete_Last (Count => 1);

New implementation...
< >
programming-idioms.org