head function

dynamic head(
  1. List list
)

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

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

Implementation

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