1
00:00:02,120 --> 00:00:04,810
So that is it for generic types already.

2
00:00:05,000 --> 00:00:10,790
They can really be tricky to understand but in the end the summary I gave you in the last lecture is

3
00:00:10,790 --> 00:00:12,580
the perfect explanation.

4
00:00:12,740 --> 00:00:20,000
They give us flexibility combined with type safety we're flexible regarding the values we pass in or

5
00:00:20,000 --> 00:00:25,640
the values we use in our class at least as long as we adhere to the possible constraints which you might

6
00:00:25,640 --> 00:00:26,510
have added.

7
00:00:26,780 --> 00:00:34,310
But we got full pipe support for what we then do with the class or with the result of a generic function

8
00:00:34,550 --> 00:00:42,080
because typescript then knows which concrete type we pass in what we call the function here or when

9
00:00:42,080 --> 00:00:44,450
we instantiate the class here.

10
00:00:44,450 --> 00:00:51,350
Here we then set a concrete type but we don't lock does class or dysfunction down to that concrete type

11
00:00:51,650 --> 00:00:52,640
when we create it.

12
00:00:52,640 --> 00:00:56,810
Instead we're flexible and might just provide some constraints.

13
00:00:56,810 --> 00:01:02,930
But of course these constraints also are optional and you might have some generic classes or generic

14
00:01:02,930 --> 00:01:07,360
functions which have no constraints and some which have a lot of constraints.

15
00:01:07,550 --> 00:01:11,420
So generic types are a really useful feature with promise and array.

16
00:01:11,420 --> 00:01:17,900
I showed you two of the many built in generic types and of course we'll also see more including custom

17
00:01:17,900 --> 00:01:19,910
generic types brought this course.
