What does typescript generic class mean?

class GenericNumber<T> {
  zeroValue:T,
  add:(x:T,y:T)=>T
}
let myGenericNumber = new GeneriNumber<number>()

let result2 = myGenericNumber.add(1, 2);
console.log(result2)

ask why there is no add method, and how should I understand the introspection class

Apr.13,2021

this has nothing to do with the paradigm. You only define the interface of add above, but it is not implemented. The
add method has no actual content, so it is sure to prompt add is not a function when called.

The

paradigm is more used to tell developers what kind of parameters this function, this class, supports and what types of return values can be obtained.

More will appear in

interface .

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5083c-43de5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5083c-43de5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?