1
+ /*
2
+ class and object or oops hume code repeat se bachta h.
3
+ abhi tak hum jo kar rahe the wo procedural tha...
4
+ es5 tk js m oops concept alag tarh se implement kiya jata tha.
5
+ es6 m class se oops concept implement kiya jata h.
6
+ js m es5 ko puri tarah remove nhi kiya gaya h.
7
+ es5 m oops concept kaise implement kiya jata tha interview m puchh sakta h.
8
+
9
+
10
+
11
+
12
+ 3 most imp words to understand
13
+
14
+ object
15
+ class
16
+ inheritance
17
+
18
+
19
+ object: things or vastu
20
+ ex: vishwjeet, hodacity car.
21
+
22
+
23
+ har object have 2 things.
24
+
25
+ 1. feature/properties: full name,height, age etc. | name,color,brand
26
+ 2. action performed by or performed on it: walk, eat,sleep | drive, repair, fuel filling i.e wo kuchh kam kar sakega ya uspe kam kiya ja sakega.
27
+
28
+
29
+ class: man
30
+ property: full name,weight, height etc.
31
+ action: walk,eat,sleep
32
+
33
+
34
+
35
+ vishwajeet(man)
36
+ Harsh(man)
37
+ saurabh(man)
38
+
39
+
40
+ i.e class is grouping of object
41
+
42
+ viswjeet is a object of man class
43
+ elon musk is a object of man class
44
+ saurabh is a object of man class
45
+
46
+
47
+ duniya m har chij ko class object se define kiya ja sakta hai...
48
+
49
+
50
+ koi v object ek ya ek se jade class ka object ho sakta h..
51
+
52
+
53
+
54
+ inheritance means dusre class ka property accuire karna.
55
+
56
+ i.e software engineer class inherit propery of man.
57
+
58
+
59
+ child: jo dusre class se property accuire karega.
60
+ parent: jo dusre class ko property inherit karega.
61
+
62
+ man: parent class
63
+ software engineer: child class
64
+ */
0 commit comments