Тест · Дженерики · урок 6 из 10
Тест — ограничение
На какой строке tsc сообщит об ошибке?
function longest<T extends { length: number }>(a: T, b: T): T {
return a.length >= b.length ? a : b;
}
console.log(longest("cat", "horse"));
console.log(longest(10, 200));