function last(xs) {
  return xs.length === 0 ? undefined : xs[xs.length - 1]
}
Get the last element.
@template T
@param {T[]} xs The array to get the last element.
@returns {T | undefined} The last element or undefined.