Appending items to a list
There are multiple ways of adding items to a list in groovy. One of them is using the <<
operator:
Another is using +
or +=
:
<<
is mutating while +=
is not - it creates a new list.
Last updated
There are multiple ways of adding items to a list in groovy. One of them is using the <<
operator:
Another is using +
or +=
:
<<
is mutating while +=
is not - it creates a new list.
Last updated