1 00:00:01,120 --> 00:00:05,740 In this video we're going to move on to our next big subject which is type meditations and type inference. 2 00:00:05,980 --> 00:00:10,000 These are technically two different systems inside of typescript but we're going to talk about them 3 00:00:10,000 --> 00:00:14,320 in parallel for a very good reason just to make things a little bit more complicated as well. 4 00:00:14,380 --> 00:00:20,580 These two different features apply slightly differently to variable declarations functions and objects. 5 00:00:20,650 --> 00:00:25,010 So we're going to first talk about type annotations and inference as applied to variables. 6 00:00:25,030 --> 00:00:29,210 We'll take a break and talk about them applied to functions and then objects and so on. 7 00:00:30,180 --> 00:00:33,970 For each of these different subjects we're going to once again through go through some plain definition 8 00:00:33,970 --> 00:00:35,270 and overview. 9 00:00:35,290 --> 00:00:38,560 Well then take a look at some different code examples that we're gonna write out together. 10 00:00:38,560 --> 00:00:41,110 You'll notice I swap these two steps right here this time around. 11 00:00:41,260 --> 00:00:45,520 So we'll then talk about why we care about this annotation and inference stuff and we'll discuss when 12 00:00:45,520 --> 00:00:46,660 to use it. 13 00:00:46,690 --> 00:00:48,510 So let's get to it. 14 00:00:48,600 --> 00:00:50,460 First off some plain definitions. 15 00:00:50,460 --> 00:00:51,840 So type meditations. 16 00:00:51,840 --> 00:00:52,730 What is that. 17 00:00:52,930 --> 00:00:58,710 A type invitation is some tiny bit of code that you and I are going to write to tell typescript what 18 00:00:58,710 --> 00:01:02,620 type of value a variable refers to. 19 00:01:02,660 --> 00:01:02,930 All right. 20 00:01:02,940 --> 00:01:06,080 Now before expanding on that definition let's talk about what type inferences. 21 00:01:06,090 --> 00:01:12,150 So type inference type script is going to attempt to automatically figure out what type of value a variable 22 00:01:12,150 --> 00:01:13,550 refers to. 23 00:01:13,660 --> 00:01:18,150 And you'll notice that the kind of definition of both these are very similar in both cases it's what 24 00:01:18,150 --> 00:01:22,860 type of valuable if you mean what type of value a variable will refer to. 25 00:01:22,860 --> 00:01:27,510 So the interesting thing about type annotations and type inference is that they're kind of at odds with 26 00:01:27,510 --> 00:01:28,380 each other. 27 00:01:28,470 --> 00:01:34,230 In one case you and I are adding in a little bit of code to tell typescript what different types we 28 00:01:34,230 --> 00:01:36,580 are working with with type inference. 29 00:01:36,600 --> 00:01:40,120 We are relying upon typescript to do that work for us. 30 00:01:40,140 --> 00:01:45,210 So these two features are a question of are you and I are going to do everything manually or are we 31 00:01:45,210 --> 00:01:46,800 going to leave it up to typescript. 32 00:01:47,220 --> 00:01:49,180 That's what the big question here is. 33 00:01:49,290 --> 00:01:53,220 And that's what got what is going to be the big focus of our discussion about you know why we care about 34 00:01:53,220 --> 00:01:54,890 these features in went to use them. 35 00:01:55,680 --> 00:01:57,020 Let's take a quick pause right here. 36 00:01:57,030 --> 00:02:00,690 We're gonna come back the next video and start taking a look at a couple of different code samples. 37 00:02:00,720 --> 00:02:02,930 So a quick pause and I'll see you in just a minute.