plusElement method

  1. @useResult
KtList<T> plusElement(
  1. T element
)

Returns a list containing all elements of the original collection and then the given element.

Implementation

@useResult
KtList<T> plusElement(T element) {
  final result = mutableListOf<T>();
  result.addAll(asIterable());
  result.add(element);
  return result;
}