Hello and welcome.
In this video I'll be showing you some variable naming convention.
These are basic rules that you need to follow when giving you a variable names.
So I'm just going to read through this table.
So the first thing to take into account is that variable names cannot start with numerical.
For example you can't use a number.
You can name a variable 3 x or 4 cars just for example.
Those would be illegal variable names.
However you can combine the numbers with text.
You can call a variable maybe cars for or go for it and things like that.
They are perfectly valid variable names.
You cannot use operators operators.
I mean either mathematical or logical operators you can't use that in variable names.
For example you can't call a variable.
This plus that or this minus that or these times that you can do that you can not to use any point suasion
marks of any kind in a javascript variable name other than the on the scope.
So you can't call your variable car core loan or car hash but you can use an underscore underscore is
allowed.
So you can give a variable name on the score car for example or something on the score something or
thing that is allowed javascript variable names most never contain spaces never for example you can't
name your variable my car space car that's not allowed.
However you can give it my car that is legal.
There cannot be any spaces between variable names variable names are case sensitive.
For example if you declare a variable called My car is different from a variable called my car or my
car.
They are all different variations.
So when you declare variable names you've got to be careful.
In the case you use so that when you want to refer to that variable name you are referencing the correct
variable.
It's like having the key to the wrong door.
If you don't have the right key you will not be able to open the door.
So you must make sure you have your variable names correct in the correct case.
Finally you cannot use any java script key words.
Key words are parts of the javascript language itself.
You cannot use any of that for variable name.
For example window is a keyword in JavaScript.
Part of the language.
Things like open as part of the language location or string.
Those are all part of the javascript language.
So it will be illegal to use them on their own.
However you can use them in combination with other things or or key words for example you can call a
variable that window or maybe my string or whatever you can combine them with other text that is acceptable.
So these are just some key basic rules you need to take into consideration when you are keeping your
variable names.
That's it for this video.
Thank you for watching.
Bye for now.