面试题答案一键面试function getFirst<T = string>(arr: T[]): T | null { return arr.length > 0 ? arr[0] : null; }