And welcome to this video.
In this video I will be introducing you to Java's group variables.
What are their Borse in Javascript javascript variables are containers for storing data values in order
to create a variable in need to use the VAR key word which is spelled fee.
Ah.
He has to be in lower case.
Also when you quit variables creating a variable means declaring variables is the same P When you declare
variables you have to assign value to variables.
You use the equal sign to assign values to a variable.
For example if I wanted to create a variable x I'm going to give it a value of 7.
Also if I want to create a variable called See My car I give it a value of poche When you are creating
variables is always a good practice to name your variables clues lead to what they are going to store.
The type of data they're going to store.
Poor example here.
And then there's variable.
My car which is an indication that the type of data storing is related to cars.
No it is a difference in the two values here.
This one here the value 7 which is a number and it is here.
The value here is support.
And I've put quote around it where you are declaimed variables.
If you are declaring a text you have to enclose it in quotes.
You either have to use single quotes or double quotes.
You can't mix them you can't use a single quote here and then a double quote here.
That's the only way the computer will understand that it is dealing with a text.
You need to enclose the values in quotes.
You don't need to do that with numbers but a computer knows that is a number.
But if you want the computer to know that is a string they call it this string in programming.
If you want to know that this is a string in it or lose it.
It's also not is of use semicolons here which is important.
That indicates that that is the end of that statement a javascript program is basically a collection
of state.
In the case this is one statement.
This indicate this is another step in because of the semicolon.
So you have to do that.
Are you declaring variables.
You can also declare variables without a sign them value.
So when you declare a variable without a value it is known as on defined.
Once you have defined or declared a variable you can change its value.
For example here have already defined the variable called my car.
If I wanted to change the value from poche for example to a range rover all I need to do is call the
variable by name and assign it different value so that we already change the value once you declare
a variable.
You can change the value a variable that is declared without a value is known as on define it also is
very important to know that javascript is case sensitive.
So for example here declare this variable.
My car car with a key.
See if I tried to reference it with a lower case c..
It will not work.
You can experiment with javascript inside your web browser.
If you are using a Mac you can access to a web browser console by clicking on option command and G.
Why do you call the web browser open.
If you are on a Windows computer and once you've got the Web browser open you can just press F 12 that
will give you the web console.
I have got the Google home page open so I'm going to access the web console just by hitting the 12 on
the keyboard and that would give me the console.
This is the developer console where you can experiment with a script.
So there are different ways you can dock it.
If you click here at the moment the doctor decide you can also dock it to the button and that will give
you the page to web page you currently view and then you can text.
With the cord on the side.
All he can do it on this side dock it to the left.
So depending on where you fancy you can lock it wherever you like.
I am going to just dock it on the net for now so let's try an experiment wait some Jabr scrip So I'm
going to declare a variable inside the console here.
Just type in the art to declare a variable.
I'll give the variable in them off thanks.
Give it the value of 7.
So now if I want to call this variable all I need to do is call the variable by his name.
If I press X it will return the value of 7.
Now that I have declared the variable I can also change its value.
All I need to do is call it by its name.
Use a post to assign different value.
Now if I quote variable x again in the longer still 7 but in our stores the same thing I declare another
variable called Let's declare a new variable and when a call is variable.
My car.
K.
My car.
OK in I'll give it my car and I'm going to give it a value off.
See porsh.
Okay.
And amid the semicolon to end that.
So now if I call these variable by its name if I see for example if I call call it by car.
It will not work.
You know why.
Because I represented in lower case you know this I use this in upper case.
So it is very important that you referenced variables the way you've defined them.
Find the hard core back and call it again.
With Casey it should return right because he's giving me a value of poche and once you declare the variable
you can easily change its name change its value.
So if I want to change that to something else I'll just call it my name.
So I want to change it to a Ford for example.
It can do a semicolon.
Now that's changed.
If I call the variable again by name it will no longer store render a vote for now storing fraud.
So these are some of the basic examples you can use to play around in the browser consider the conses
very useful for playing around with little little looking values like this so you can experiment and
get acquainted.
So that's it for this feed you on Javascript variable.
Many thanks.
Bye for now.