Skip to content

Commit 1c812d7

Browse files
committed
Update Basic Folder
1 parent 3e30143 commit 1c812d7

File tree

5 files changed

+56
-35
lines changed

5 files changed

+56
-35
lines changed

01_Basic/01_Variable.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,22 @@ accountEmail="[email protected]"
1010
accountPassword="singh"
1111
accountCity="Bihar"
1212

13-
console.log(accountId);
13+
console.log(accountId); //144553
1414

15-
//Prefer not to use var because of issue in block scope and functional Scope
15+
//Prefer not to use =>var<=
16+
// because of issue in block scope and functional Scope
1617

17-
console.table([accountId,accountEmail,accountPassword,accountCity,accountState])
18+
console.table([accountId,accountEmail,accountPassword,accountCity,accountState]) //Output
19+
// ┌─────────┬───────────────────┐
20+
// │ (index) │ Values │
21+
// ├─────────┼───────────────────┤
22+
// │ 0 │ 144553 │
23+
// │ 1 │ '[email protected]' │
24+
// │ 2 │ 'singh' │
25+
// │ 3 │ 'Bihar' │
26+
// │ 4 │ undefined │
27+
// └─────────┴───────────────────┘
28+
29+
30+
31+

01_Basic/02_DataType.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ let count= null
3030
// object
3131

3232

33-
console.log(typeof "hitesh")
34-
console.log(typeof age)
33+
console.log(typeof "hitesh") //string
34+
console.log(typeof age) //number
3535
console.log(typeof null) // object
3636
console.log(typeof undefined) //undefined
3737

01_Basic/03_conversionOperation.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ console.log(booleanIsLoggedIn)
2121
// "hitesh" => true
2222

2323
let someNumber =33
24-
2524
let stringNumber = String(someNumber)
2625
console.log(stringNumber)
2726
console.log(typeof stringNumber)
@@ -53,16 +52,17 @@ console.log(1+2+"2"); //output =>32
5352

5453

5554

56-
console.log(+true);
57-
console.log(+"");
55+
console.log(+true); //output => 1
56+
console.log(+""); //output => 0
5857

5958
let num1,num2,num3
6059

6160
num1=num2=num3=2+2
6261

6362
let gameCounter=100
64-
++gameCounter
65-
gameCounter++;
63+
++gameCounter //First increase The ValueThen Use The Variable Value
6664
console.log(gameCounter);
65+
gameCounter++; //First use The Variable Value Then Increase the value
66+
console.log(gameCounter);
6767

6868

01_Basic/04_Comparison.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
console.log(2>1)
2-
console.log(2 >=1)
3-
console.log(2<1)
4-
console.log(2 ==1);
5-
console.log(2!=1);
1+
console.log(2>1) // true
2+
console.log(2 >=1) //true
3+
console.log(2<1) //flase
4+
console.log(2 ==1); //false
5+
console.log(2!=1); //true
66

77

8-
console.log("2" > 1);
9-
console.log("02" > 1);
8+
console.log("2" > 1); //true
9+
console.log("02" > 1); //true
1010

1111
console.log(null >0) //false
1212
console.log(null == 0) //false
1313
console.log(null >= 0) //true
14-
14+
// ^
15+
// |
16+
// |
1517
// The reason is that an equality check == and comparisons > < >= <= work differently.
1618
// Comparions convert null to a number, treating it as 0
1719
// That's why (3) null >=0 is true and (1) null >0 is false.
@@ -22,4 +24,4 @@ console.log(undefined <0) //false
2224

2325
// === => strict check
2426

25-
console.log("2" === 2)
27+
console.log("2" === 2) //false

01_Basic/dataype-summary.js

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
// #Primitive Data Type
88
// 7 type : String, Number , Boolean, null, undefined, symbol,Bigint
99

10-
const score = 100
11-
const scoreValue=100.3
10+
const score = 100 //number
11+
const scoreValue=100.3 //number
1212

13-
const isLoggedIn =false
14-
const outsideTemp= null
15-
let userEmail="email"
13+
const isLoggedIn =false //Boolean
14+
const outsideTemp= null //null
15+
let userEmail="email" //string
1616

17-
const id =Symbol('123')
18-
const anotherId=Symbol('123')
17+
const id =Symbol('123') //symbol
18+
const anotherId=Symbol('123') //symbol
1919

20-
console.log(id);
21-
console.log(anotherId);
22-
console.log(id == anotherId);
20+
console.log(id); //Symbol(123)
21+
console.log(anotherId); //Symbol(123)
22+
console.log(id == anotherId); //false
2323

2424
const bigNumber = 3411541515151994n
2525

@@ -40,7 +40,7 @@ const bigNumber = 3411541515151994n
4040
}
4141

4242

43-
console.log(typeof myfunction)
43+
console.log(typeof myfunction) //function
4444

4545
/*
4646
@@ -76,19 +76,24 @@ let anotherName = myname
7676

7777
anotherName = "rajesh"
7878

79-
console.log(myname);
80-
console.log(anotherName);
79+
console.log(myname); //ankit
80+
console.log(anotherName); //rajesh
81+
82+
// In This Data Type we pass the copy of variable's value
8183

8284
// Heap => Non-Primitive
8385

8486
let user1 = {
85-
email: "emai@gmail.com",
87+
email: "email@gmail.com",
8688
upi: "user@mpl"
8789
}
8890

8991
let user2 = user1
9092

93+
console.log(user1); //{ email: 'email@gmail.com', upi: 'user@mpl' }
94+
console.log(user2); //{ email: 'email@gmail.com', upi: 'user@mpl' }
95+
9196
user2.email ="[email protected]"
9297

93-
console.log(user1);
94-
console.log(user2);
98+
console.log(user1); //{ email: 'e-mail@gmail.com', upi: 'user@mpl' }
99+
console.log(user2); //{ email: 'e-mail@gmail.com', upi: 'user@mpl' }

0 commit comments

Comments
 (0)