So to dive into JavaScript,
let's get started by understanding Values.
And what do I mean by that?
When we write code,
especially when we write JavaScript code,
we typically have the intention of manipulating
what the user sees on the screen.
Outputting some texts, updating some texts,
maybe outputting some number, anything like that.
And therefore, we typically work with Values in our code.
We might be working with some text,
maybe some texts the user entered in an input,
like we did it in this little demo,
I showed you a couple of minutes ago,
where we used that user input
to then count the number of characters.
And therefore, working with text or strings
as it's called in programming, is very common.
And that's a typical value we work with in JavaScript.
Now, as a side note,
I will say string from now on when I'm referring to text,
because that's the official name of text values,
it's called String because historically we always considered
text to be a string of characters.
And therefore, we call text Strings.
And String Values are one key value type
we work with all the time in programming.
But another key value type would, for example,
be numbers.
That could be an age of a user or again,
to come back to that example which I showed you,
the length of that text.
So the number of characters off the text the user entered,
that of course would be a number.
And numbers are another key value type we work with
when we write code.
And there other value types as well,
which we are going to see throughout
this course section and this course.
But text, so strings and numbers are the two,
I would say most important value types
you work with all the time.
And thankfully,
they are quite straightforward to understand.
And when we write JavaScript code,
we often will be dealing with these values.
We will be transforming text values,
or we will be deriving number values or making mathematical
calculations, anything like that.
Now, when we work with values,
we typically do that in the context of variables, though.
And that's another key concept, which you by the way,
will encounter in basically every programming language
out there, not just in JavaScript.
A variable is basically a box, a container.
You could say variables are labeled data containers.
And the idea is the following.
If you have a certain value,
let's say the text, the string, a user entered,
or the length of that text.
So a number.
Then you might want to store that value in such
a data container so that you can use it later on
in your code, in a different operation.
And you'll see this in action very soon.
And then this will make more sense.
But the idea is important that you have values,
which you want to store in some data container
so that you can use them later.
Maybe, also multiple times in different calculations.
And you do that with the help of such data containers,
which also have names or labels,
however you want to call it.
Which you can choose as a developer to make sure that you
can later reference the correct data container,
if you needed.
It's a little bit like putting an item into a box,
let's say your tax documents,
you put them into a box and you put a label on to that box
that says tax documents.
And if you then need those documents a year from now,
or in two years, or at any other point of time,
then you can just search for that box, thanks to that label,
it should be easy to find and you can take the items,
the tax documents, out of that box.
And it's the same concept applied here in programming.
But that's the theory.
Let's see it in action.
Let's see some concrete code.