# Javascript Data Types

Data types are data items defined by the value it can take and the operations that can be performed on it. This means that a variable can hold value of a different type.
 Javascript primitive data types include;

 1.number
 2.string 
 3.boolean 
 4.null
 5.undefined  
 6.Bigint
 7.Symbol

And now to explain each type using examples

****1.number

```
let data = 120; //declare a variable and initialize it's value with an integer
  console.log(typeof(data));// number

``` 
Javascript uses  the ```number```  type to represent both integers and floating-point values.
By floating-point I mean values that have decimal places (23.55)

  **NaN**
I'm sure you've seen this value in your console and it simply stands for Not a Number. It is a special numeric value that indicates an invalid number eg

```
 console.log('i' /5); //  NaN

``` 
**2.String**

To simply explain , a string is a sequence of one or more characters bounded by a string literal() that begins and ends with either a single quote or a double quote.


```
let greeting = "Hello" //double quote
let message  = ' how are you holding up ?' // single quote
``` 
If you want to use a single quote in string after using the single quote then you have to escape it using a backlash.
``` 
let message = '  I\m doing great' // use \ to escape a single quote

``` 
**3.boolean**

The ```boolean```  type has two literal values either ```true```  or ```false``` in lowercase.
Javascript allows other data types to be converted to boolean data types using ```boolean()``` function.
eg

```
console.log(Boolean('Hello')) // true
console.log(Boolean('')) // false

``` 
**4.null & 5.undefined**

Javascript defines ```null```  as equal to ```undefined``` .
Whenever a variable is declared but not initialized then the value is undefined .

```
let day;
console.log(day) // undefined

console.log(null==undefined) //true
``` 
 **5 & 6**

These are new forms of ES6  primitive data types and I'll update in simple terms once I understand better.

Enjoy the read folks and give your feedback too.








