initial function

List initial(
  1. List list
)

Gets all but the last element of list. Example

initial([1, 2, 3]);
// Returns [1, 2]

Implementation

List initial(List list) {
  return list.length != 0 ? slice(list, 0, -1) : [];
}