1 00:00:01,030 --> 00:00:05,030 In the last video he spoke about why the any type is a very bad thing to have inside of application 2 00:00:05,600 --> 00:00:11,720 right now coordinates is of type any and it's only the case because Jason got returns a value of type 3 00:00:11,720 --> 00:00:12,100 any. 4 00:00:12,200 --> 00:00:17,280 And that's because typescript just can't predict what Jason does pass is going to return. 5 00:00:17,280 --> 00:00:24,020 So to fix this up one way we could fix it is to add in a type invitation for coordinates so we need 6 00:00:24,020 --> 00:00:27,260 to add in a type invitation for an object. 7 00:00:27,410 --> 00:00:32,920 We already saw an example of that right back up here when we defined the object literal of points. 8 00:00:33,130 --> 00:00:38,510 So to add in a type annotation for an object right after the variable name were put in that colon and 9 00:00:38,510 --> 00:00:44,280 then the overall structure of that object so for us we're going to add in coordinates right here. 10 00:00:44,300 --> 00:00:49,310 I'll put in a colon then instead of curly braces and inside they're going to say this thing is going 11 00:00:49,310 --> 00:00:54,830 to have a property called X that is a number and it's going to have a property y that is a number as 12 00:00:54,830 --> 00:01:01,510 well so now we've given enough information to typescript that it can figure out what type of value coordinates 13 00:01:01,510 --> 00:01:03,300 is by now mouse over it. 14 00:01:03,310 --> 00:01:05,690 I see the type indentation on here. 15 00:01:05,690 --> 00:01:10,570 And now if I tried to reference say coordinates dot blah blah blah I'll very quickly see an error message 16 00:01:10,570 --> 00:01:15,130 that tells me that is not a property on that object okay. 17 00:01:15,170 --> 00:01:16,160 That's pretty much it. 18 00:01:16,190 --> 00:01:21,200 This is one of the three cases where we are going to add in type annotations anytime we call a function 19 00:01:21,380 --> 00:01:27,020 that returns type any adjacent dot pass is just one of the functions in javascript that returns type 20 00:01:27,020 --> 00:01:27,230 any. 21 00:01:27,230 --> 00:01:29,000 There are several others as well. 22 00:01:29,070 --> 00:01:32,030 It's will kind of see some those different functions over time. 23 00:01:32,030 --> 00:01:36,980 And in fact we might eventually have to write our own functions that return type any as well. 24 00:01:37,020 --> 00:01:37,220 All right. 25 00:01:37,250 --> 00:01:38,430 Let's take a quick pause right here. 26 00:01:38,460 --> 00:01:43,320 When we come back the next video we'll move on to the next example or the next case where we are going 27 00:01:43,320 --> 00:01:48,500 to add in a type annotation willingly so quick pause and I'll see you in just a minute.