October 2017
Intermediate to advanced
280 pages
6h 50m
English
TypeScript allows us to use multiple type parameters:
class Pair<K, V> {
key: K;
value: V;
}
In this case, we can create an instance of the Pair<K, V> class using the following syntax:
let pair = new Pair<string, number>(); pair.key = 'foo'; pair.value = 42;
Read now
Unlock full access