Let's talk about data types in JavaScript.
Let me show you what it means with the previous code.
This is where we left.
As you can see, we are declaring a variable and assign a value into it.
And remember, programming is all about data.
I mean, dealing with data, for example, uses or any kind of data.
And we have different types of data that we can work with.
And this is what we call data types.
Meaning the type of data that we can use to store into a variable.
And in programming, we have a couple of them.
So let's look at some of the examples of data that we can use in JavaScript.
And this is what we call data types.
Let's look at the types of data in JavaScript and it has been categorized into two.
One is called the primitive data type, and these are the data that cannot be changed once they are
set and hold only one value at a time.
So these data types cannot be changed.
For example, if we assign a value to them and also they can hold only one value at a time.
Back to this code.
As you can see, each of these variables can hold a value at a time.
Let's say we want to store complex data about a user.
We want to keep track about the user's name, his age, country profile and other properties.
This is not the best way to go.
So let's look at the next type of data.
And it's called non-primitive.
And they are reference types or object that are more complex and can store multiple values as a single
entity.
So for this type of data, we can store multiple data.
I will show you with code.
So let's look at the types of data types and primitive.
And one is called the strings.
And in this code, that is line number five for the city.
As you can see, we are saving a string.
And a string is any value that has code around it.
And we have what is called numbers, as you know, and Boolean values.
When you say Boolean values, they are values that yield only two answers, whether true or false.
For example, are you married?
Yes or no?
Are you a student?
Yes or no?
And we call this one as a boolean value.
And the next type is called null, meaning that it has no value and we have undefined.
Also, these two don't have any value in them, but it depends on some use cases where we need to use
one of these.
And lastly, this is a new feature that has been emerged and this is called Symbol.
So I will show you examples of all of these primitive data types.
Now let's move on.
The non primitive.
An example of this is called object simply means that we can store any kind of property in a single
value.
And this is what we call object.
And we have what is called functions.
And functions are the backbone of any programming languages.
So we will talk about examples of all of these ones in this course.
And lastly is about arrays.
Don't worry about these ones.
Arrays are used to store data in a single value, but they are index based.