sdf-2d-demo/src/helper/last.ts
schmelczerandras 36f01c6716 Copy files
2020-09-16 16:03:01 +02:00

3 lines
99 B
TypeScript

export function last<T>(a: Array<T>): T | null {
return a.length > 0 ? a[a.length - 1] : null;
}