1
00:00:00,290 --> 00:00:05,180
Let's talk about data types in JavaScript.

2
00:00:05,840 --> 00:00:10,450
Let me show you what it means with the previous code.

3
00:00:10,460 --> 00:00:12,470
This is where we left.

4
00:00:13,070 --> 00:00:20,000
As you can see, we are declaring a variable and assign a value into it.

5
00:00:20,630 --> 00:00:24,740
And remember, programming is all about data.

6
00:00:25,220 --> 00:00:31,190
I mean, dealing with data, for example, uses or any kind of data.

7
00:00:31,610 --> 00:00:36,950
And we have different types of data that we can work with.

8
00:00:37,500 --> 00:00:40,620
And this is what we call data types.

9
00:00:40,830 --> 00:00:48,000
Meaning the type of data that we can use to store into a variable.

10
00:00:48,660 --> 00:00:52,230
And in programming, we have a couple of them.

11
00:00:52,620 --> 00:00:59,660
So let's look at some of the examples of data that we can use in JavaScript.

12
00:00:59,670 --> 00:01:03,090
And this is what we call data types.

13
00:01:03,210 --> 00:01:10,680
Let's look at the types of data in JavaScript and it has been categorized into two.

14
00:01:10,860 --> 00:01:20,460
One is called the primitive data type, and these are the data that cannot be changed once they are

15
00:01:20,460 --> 00:01:25,230
set and hold only one value at a time.

16
00:01:25,650 --> 00:01:29,960
So these data types cannot be changed.

17
00:01:30,000 --> 00:01:38,580
For example, if we assign a value to them and also they can hold only one value at a time.

18
00:01:38,580 --> 00:01:40,080
Back to this code.

19
00:01:40,200 --> 00:01:46,470
As you can see, each of these variables can hold a value at a time.

20
00:01:47,090 --> 00:01:51,530
Let's say we want to store complex data about a user.

21
00:01:51,770 --> 00:02:00,080
We want to keep track about the user's name, his age, country profile and other properties.

22
00:02:00,110 --> 00:02:02,360
This is not the best way to go.

23
00:02:02,510 --> 00:02:05,240
So let's look at the next type of data.

24
00:02:05,240 --> 00:02:07,820
And it's called non-primitive.

25
00:02:08,090 --> 00:02:19,400
And they are reference types or object that are more complex and can store multiple values as a single

26
00:02:19,400 --> 00:02:20,240
entity.

27
00:02:20,900 --> 00:02:26,390
So for this type of data, we can store multiple data.

28
00:02:26,960 --> 00:02:28,830
I will show you with code.

29
00:02:28,850 --> 00:02:33,050
So let's look at the types of data types and primitive.

30
00:02:33,050 --> 00:02:35,660
And one is called the strings.

31
00:02:35,810 --> 00:02:39,340
And in this code, that is line number five for the city.

32
00:02:39,350 --> 00:02:42,650
As you can see, we are saving a string.

33
00:02:42,650 --> 00:02:47,660
And a string is any value that has code around it.

34
00:02:47,840 --> 00:02:54,200
And we have what is called numbers, as you know, and Boolean values.

35
00:02:54,230 --> 00:03:02,150
When you say Boolean values, they are values that yield only two answers, whether true or false.

36
00:03:02,180 --> 00:03:04,580
For example, are you married?

37
00:03:04,610 --> 00:03:05,940
Yes or no?

38
00:03:05,960 --> 00:03:07,090
Are you a student?

39
00:03:07,100 --> 00:03:08,180
Yes or no?

40
00:03:08,180 --> 00:03:11,210
And we call this one as a boolean value.

41
00:03:11,210 --> 00:03:18,740
And the next type is called null, meaning that it has no value and we have undefined.

42
00:03:18,770 --> 00:03:27,810
Also, these two don't have any value in them, but it depends on some use cases where we need to use

43
00:03:27,810 --> 00:03:28,970
one of these.

44
00:03:28,980 --> 00:03:35,220
And lastly, this is a new feature that has been emerged and this is called Symbol.

45
00:03:35,250 --> 00:03:40,770
So I will show you examples of all of these primitive data types.

46
00:03:40,800 --> 00:03:42,260
Now let's move on.

47
00:03:42,270 --> 00:03:44,270
The non primitive.

48
00:03:44,280 --> 00:03:52,140
An example of this is called object simply means that we can store any kind of property in a single

49
00:03:52,140 --> 00:03:52,740
value.

50
00:03:52,740 --> 00:03:55,050
And this is what we call object.

51
00:03:55,050 --> 00:03:57,660
And we have what is called functions.

52
00:03:57,660 --> 00:04:02,280
And functions are the backbone of any programming languages.

53
00:04:02,280 --> 00:04:07,140
So we will talk about examples of all of these ones in this course.

54
00:04:07,140 --> 00:04:09,750
And lastly is about arrays.

55
00:04:10,020 --> 00:04:11,760
Don't worry about these ones.

56
00:04:11,790 --> 00:04:17,550
Arrays are used to store data in a single value, but they are index based.

