# JavaScript Data Types

In JavaScript, data types are used to represent different kinds of values that can be manipulated by the program. There are seven basic data types in JavaScript:

1) Undefined

2) Null

3) Boolean

4) Number

5) String

6) Symbol (added in ECMAScript 6)

7) Object

Let's take a closer look at each of these data types with examples:

1) Undefined:

The undefined data type represents a value that has not been assigned a value. It is often used to represent missing or undefined values. For example:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678788918612/c283af56-516c-48ed-9716-c620fe87d653.jpeg align="center")

2) Null:The null data type represents a deliberate non-value or absence of any object value. It is often used to represent intentionally missing values. For example:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678788979122/3c9fea66-7717-4d7e-96de-1a6cb09c9625.jpeg align="center")

3) Boolean:

The boolean data type represents true/false values. It is often used in conditional statements and logical operations. For example

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678789020432/fc31b528-dd92-4c3b-a547-77a0b56bf74e.jpeg align="center")

  
4) Number:

The number data type represents numeric values. It can represent both integer and floating-point values. For example:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678789106345/a40a1eee-fc34-4e0d-a1c7-674841cc12d9.jpeg align="center")

5) String:The string data type represents textual data. It is often used to store and manipulate strings of characters. For example:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678789162643/86eb2d2a-125a-4baf-b6cc-86374a8f95e6.jpeg align="center")

6) Symbol:

The symbol data type represents a unique identifier. It is often used to define private object properties or to create custom iterators. For example:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678789212981/a86a8c02-8dce-4f78-80ef-d77800041707.jpeg align="center")

7) Object:The object data type represents a collection of properties and values. It can be used to store and manipulate complex data structures. For example:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1678789260665/598f92ae-a64d-4b99-8930-c1ff0e3a52da.jpeg align="center")

In summary, understanding the different data types in JavaScript is important for writing effective and efficient code. By using the appropriate data types for different types of data, you can ensure that your code is more readable, maintainable, and scalable.

That's it for JavaScript Data Types. Thanks for reading and learning ❤️
