append

fun <E2> List<E2>.append(lastElement: E2): List<E2>

Produce a new immutable list based on the prefix List (which must not be modified after this operation) and the new element to follow them.

Receiver

The leading elements of the list.

Return

A new immutable list with all those elements.

Parameters

lastElement

The value by which to extend the list.

E2

The list's element type.