Now let's talk about variables.
Variables is like a container, a container that store data.
So if you have data that needs to be stored and then reuse it so many times or multiple times inside
of your code, it's better to use variables.
The best way to show you how to do that is actually over here in the console.
To create your first variable, you must start with the LAT command.
So when you type let JavaScript knows here comes a variable and then you give the variable name.
So for example, I want to create a variable that can store my first name and then my last name, and
then the third one will be my age.
So the first one is going to be first name.
I'm going to type first name.
And every time you create a variable, make sure these variable means something.
If someone is reading that code, if I make my first variable to restore the first name, yeah as f
n.
It doesn't make too much sense.
It's too short.
And you can get very confused later on.
So don't worry about writing big pieces of four or two or three sequence of words, because the more
you explain, the better your code will be later on.
My first one is first name and the first letter is always in lowercase and then the first letter of
the second word.
It's always uppercase and so on from that equals two.
And what kind of data do I need to store?
Not what kind.
What data do I need to store store in these first variable?
So the data will be my name.
So over here, some developers, they put a semicolon.
In my case I won't.
And that's my first variable.
So let first name and Andre.
Can I use this variable?
And return the result of this variable into the console?
Yes, I can.
So the first one in here.
Just going to remove this part and type first name.
So console.log.
First name.
I'm going to save.
Go to the console and I have my name in the line in number six.
So line number six means the console log.
It's logging whatever is inside.
Let me just clean my screen.
Whatever is inside.
These variable end inside the variable.
It's my name.
So my name is in here.
And the line number six, it's going to the console.
Great.
So that works.
That means I can create my second one.
Let.
Last name equals to and Iacono.
Perfect.
So first name and then last name.
Save the configs.
Check over there.
Then I have my first and last name.
I also can create a variable.
Not a string, just a string, but a number.
So let's go for.
Age equals to 28.
As I'm 28 years old.
Save.
And the console is not showing because we don't have the console.
So console.
Dot log and over here, h I just scroll, bring this back up, save the configs and I have the number
28 over here.
So great.
The variables are working, but I'm a little bit far from what we are expecting for this project.
Number one, Yeah, the product.
Number one was my name is and then my name and I am my age years old.
So how can I concatenate those two informations.
Yeah.
Text and a variable right now let me explain that into the next class.