Skip to content

Commit a6b4625

Browse files
committed
Add DataType-Summary
1 parent 444e5bc commit a6b4625

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

01_Basic/dataype-summary.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// how we store data and access data
2+
// On basis of it we catgories datatype into 2 parts
3+
// 1.Primitive Data Type 2.Non primitive DataType
4+
5+
6+
7+
// #Primitive Data Type
8+
// 7 type : String, Number , Boolean, null, undefined, symbol,Bigint
9+
10+
const score = 100
11+
const scoreValue=100.3
12+
13+
const isLoggedIn =false
14+
const outsideTemp= null
15+
let userEmail
16+
17+
const id =Symbol('123')
18+
const anotherId=Symbol('123')
19+
20+
console.log(id);
21+
console.log(anotherId);
22+
console.log(id == anotherId);
23+
24+
const bigNumber = 3411541515151994n
25+
26+
// #Refernece type or Non-primitive DataType
27+
// - Array
28+
// - objects
29+
// - Functions
30+
31+
const heros= ["hanuman","shri ram","shiv ji"]
32+
33+
let myobj= {
34+
name: "hitesh",
35+
age: 22,
36+
}
37+
38+
const myfunction = function(){
39+
console.log("Hello World")
40+
}
41+
42+
43+
console.log(typeof myobj)
44+
45+
46+
47+
//Dynmaic or Static Type Language ?
48+
49+
// =>JavaScript is a dynamic language and not static,
50+
//which means that variables can hold values of different types during runtime.
51+
//Unlike languages such as Typescript or Java, you don’t need to declare the data type of a variable explicitly.

0 commit comments

Comments
 (0)