Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SincereCSL/Playgrounds
/ Length
Interface
Length
TypeScript/StudyTypeScript/src/generics_02.ts:22–24 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
20
/// 泛型约束
21
//定义一个接口
22
interface
Length {
23
length: number
24
}
25
function
log3<T extends Length>(value: T): T{
26
console.log(value,value.length)
27
return
value
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected