1
00:00:00,260 --> 00:00:01,609
In this video.

2
00:00:01,609 --> 00:00:11,220
Let's talk about syntax for variable declarations, meaning how we can write or use variables.

3
00:00:11,240 --> 00:00:16,040
So let's see the syntax or how to create.

4
00:00:16,250 --> 00:00:25,990
First of all, in JavaScript there are three ways to declare variables and it start with a keyword.

5
00:00:26,000 --> 00:00:29,540
And for these keywords we have three types.

6
00:00:29,570 --> 00:00:37,660
The first one is to use var and var is function, scope or globally scoped.

7
00:00:37,880 --> 00:00:40,970
But don't worry about this technical term.

8
00:00:41,090 --> 00:00:49,640
The key point here is that we can declare a variable using var keyword and I'll explain this one to

9
00:00:49,640 --> 00:00:55,310
you as you move on in this course, because these are advanced concepts.

10
00:00:55,670 --> 00:01:00,390
The next point is that we can use let keyword also.

11
00:01:00,390 --> 00:01:05,650
So to create a variable and let is a block scope.

12
00:01:05,670 --> 00:01:09,330
Again, don't worry about these technical terms here.

13
00:01:09,450 --> 00:01:14,310
The key point here is or are the var let.

14
00:01:14,310 --> 00:01:19,410
And lastly, we can declare a variable using const.

15
00:01:20,100 --> 00:01:24,030
So let's look at the actual syntax.

16
00:01:24,360 --> 00:01:27,510
Let's say that this is our code.

17
00:01:28,110 --> 00:01:34,230
As you can see, before declaring a variable, you need to bring in what is called a keyword.

18
00:01:34,770 --> 00:01:41,430
And this keywords are what we have just listed, and one of them is the const.

19
00:01:41,430 --> 00:01:45,450
So we can use const or var or let.

20
00:01:46,050 --> 00:01:56,010
Again, declaring a variable must begin with a keyword and these keywords are var, let or const, and

21
00:01:56,010 --> 00:02:05,010
from there we name our variable meaning we are going to name our box and we call this one as the variable

22
00:02:05,010 --> 00:02:05,760
name.

23
00:02:05,760 --> 00:02:12,740
And lastly, some value what we want to keep inside the variable.

24
00:02:12,750 --> 00:02:14,540
So it goes like this.

25
00:02:14,550 --> 00:02:22,950
This is like a container or our box and this is a value that we want to put inside the box.

26
00:02:22,950 --> 00:02:29,730
So now this is the value and this is the container or box and this is the keyword.

27
00:02:29,760 --> 00:02:36,060
Now that we know the structure for declaring variables, the next video, we will get back to code.

