Say I want to declare an array of generics in Typescript. What would be the equivalent of the unknown wildcard '?' in Java?
This does compile, but seems a little awkward MyGeneric<any>[];
I would like a declaration equivalent to Java MyGeneric<?>[];
, that is, a single type array, but the type is not known when it is declared.
Cheers.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…