export default function lastOf(array: readonly T[] | undefined): T | undefined { return array?.[array.length - 1]; }