MCPcopy Create free account
hub / github.com/SincereCSL/Playgrounds / Log

Class Log

TypeScript/StudyTypeScript/src/generics_02.ts:3–9  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1/// 泛型: 泛型类与泛型约束
2/// 泛型类
3class Log<T> {
4 // static run(value: T) { // 泛型不能用于类的静态成员
5 run(value: T) {
6 console.log(value)
7 return value
8 }
9}
10
11// let log1 = new Log<number>()
12// log1.run(1)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected