Skip to content

Commit 044d8d8

Browse files
authored
Add: Data types(Dyanmic, primitives)
1 parent c81395c commit 044d8d8

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ One place JavaScript!
77
- [Callback/ Higher-order Function](#callback)
88
- [Promises](#promises)
99
- [Closures](#closures)
10-
- [Splice vs Slice vs Split](#sdiff)
10+
- [Splice vs Slice vs Split](#diffs)
11+
- [Data Types](#datatypes)
1112

1213
<a name=“callback”/>
1314

@@ -115,4 +116,35 @@ let res = str.split(" ");
115116

116117
res
117118
(5) ["How", "are", "you", "doing", "today?"]
119+
```
120+
121+
<a name=“datatypes”/>
122+
123+
#### Data Types
124+
125+
## Dynamic typing
126+
127+
JavaScript is Dynamic/ loosly typed language. Variables are not associate with any *types* in js.
128+
129+
```javascript
130+
var a = "github";
131+
typeof(a); // a is type of string
132+
a = 5;
133+
typeof(a); // a is type of number
134+
a = true;
135+
typeof(a); // a is type of "boolean"
136+
137+
```
138+
139+
With Latest ECMA, JS has 7 data types
140+
141+
Six primitive data types:
142+
1. Boolean
143+
2. String
144+
3. Number
145+
4. Null
146+
5. Undefined
147+
6. Symbol (Introduced in ES6)
148+
149+
7. Object // This is not primitive data type.
118150

0 commit comments

Comments
 (0)