In this video, we're going to move on to our next big subject, which is type annotations and type
inference.
These are technically two different systems inside of TypeScript, but we're going to talk about them
in parallel for a very good reason, just to make things a little bit more complicated as well.
These two different features apply slightly differently to variable declarations, functions and objects.
So we're going to first talk about type annotations and inference as applied to variables.
And we'll take a break and talk about them applied to functions and then objects and so on.
For each of these different subjects, we're going to once again through go through some plain definition
and overview.
Well, then take a look at some different code examples that we're going to write out together.
You'll notice I swap these two steps right here this time around.
So we'll then talk about why we care about this annotation and infant stuff and we'll discuss when to
use it.
So let's get to it.
First off, some plane definitions, so type annotations, what is that a type annotation is some tiny
bit of code that you and I are going to write to tell typescript what type of value a variable refers
to.
All right, now, before expanding on that definition, let's talk about what type inferences, so it's
type inference, TypeScript, is going to attempt to automatically figure out what type of value a variable
refers to.
And you'll notice that the kind of definition of both these are very similar in both cases.
It's what type of valuable, what type of value, a variable.
What will it refer to?
So the interesting thing about type annotations and type of inference is that they're kind of at odds
with each other.
In one case, you and I are adding in a little bit of code to tell TypeScript what different types we
are working with, with type inference.
We are relying upon TypeScript to do that work for us.
So these two features are a question of are you and I are going to do everything manually or are we
going to leave it up to TypeScript?
That's what the big question here is.
And that's why what is going to be the big focus of our discussion about, you know, why we care about
these features and when to use them?
Let's take a quick pause right here.
We're going to come back to the next video and start taking a look at a couple of different code samples.
So quick pause and I'll see you in just a minute.