Home > Software design >  What does the below statement mean?
What does the below statement mean?

Time:08-11

Does it means that the given datatype can store number and Datatype T? type Address<T extends string> = number & { type: T }

CodePudding user response:

That means

Address is an alias for the intersection type of number and the generic type T.

type Address<T extends string> = number & { type: T }

Intersection means that Address will have all features of both types.

  • Related