Главное, что ответили
Size: a a a
SS
AE
<T[]>?
SS
function loggingIdentity<Type>(arg: Type): Type {
console.log(arg.length);
Property 'length' does not exist on type 'Type'.
return arg;
}
........................................
interface Lengthwise {
length: number;
}
function loggingIdentity<Type extends Lengthwise>(arg: Type): Type {
console.log(arg.length); // Now we know it has a .length property, so no more error
return arg;
}
YK
SS
SS
SS
DB
DB
DB
SS
P
AE
printAnything<number | string>([1, 2, ''])
SS
B
AE
NK
YK