In the last video, he spoke about why the new type is a very bad thing to have inside of application
right now, coordinates is of type any and it's only the case because Jason Persse returns a value of
type any.
And that's because TypeScript just can't predict what Jason is going to return.
So to fix this up, one way we could fix it is to add in a type annotation for coordinates.
So we need to add in a type invitation for an object, we already saw an example of that right back
up here when we define the object, literal of point.
So to add in a type annotation for an object right after the variable name were put in that colon and
then the overall structure of that object.
So for us, we're going to add in coordinates right here, I'll put in a colon then instead of curly
braces and inside they're going to say this thing is going to have a property called X that is a number
and it's going to have a property Y that is a number as well.
So now we've given enough information to TypeScript that it can figure out what type of value coordinates
is by now mouseover it, I see the type annotation on here and now if I try to reference, say, coordinates,
dot, blah, blah, blah, I'll very quickly see an error message that tells me that is not a property
on that object.
OK, so that's pretty much it.
This is one of the three cases where we are going to add in type annotations anytime we call a function
that returns type any adjacent parts is just one of the functions in JavaScript that returns type any.
There are several others as well.
So we'll kind of see some of those different functions over time.
And in fact, we might eventually have to write our own functions that return type any as well.
All right, let's take a quick pause right here.
When we come back in the next video, we'll move on to the next example or the next case where we are
going to add in a type invitation willingly.
So quick pause and I'll see you in just a minute.