head function

dynamic head (
  1. List array
)

Finds the first element in the array Uses dart's List.first property Example

_.head(["Dart", "Javascript", "Swift"]);
// Returns "Dart"

Implementation

dynamic head(List array) {
  return array.first;
}