|
35 | 35 |
|
36 | 36 | // Classes And Objects |
37 | 37 |
|
38 | | -// In OOP A Class Is An Extensible Program Code Template For Creating Objects, Providing Intial Value For State (Member Variables) And Implementation Of Behavior (Member Functions) |
| 38 | +// In OOP A Class Is An Extensible Program Code Template For Creating Objects, Providing Initial Value For State (Member Variables) And Implementation Of Behavior (Member Functions) |
39 | 39 |
|
40 | 40 | // Syntax: |
41 | 41 | // class ClassName { |
|
82 | 82 | // We Can Than Use New Class() To Create An Object |
83 | 83 |
|
84 | 84 | // Constructor Method |
85 | | -// A Constructor Is A Special Method Which Is Automatically Called When An Object Is Created. -> Its Used To Initiailise The Object. |
| 85 | +// A Constructor Is A Special Method Which Is Automatically Called When An Object Is Created. -> Its Used To Initialize The Object. |
86 | 86 |
|
87 | 87 | // Old |
88 | 88 |
|
|
148 | 148 | // harryForm.preview() |
149 | 149 |
|
150 | 150 |
|
151 | | -// Class Inhertance |
| 151 | +// Class Inheritance |
152 | 152 |
|
153 | 153 | // Class Inheritance Is A Way For One Class To Inherit All The Methods And Properties From Another Class. In JavaScript, It Is Done By Using Extends Keyword. |
154 | 154 |
|
|
189 | 189 |
|
190 | 190 | // Class Child extends Parent |
191 | 191 |
|
192 | | -// Parent Classe Is The Class From Which Other Class Inherits. |
| 192 | +// Parent Classes Is The Class From Which Other Class Inherits. |
193 | 193 | // class Animal { |
194 | 194 | // constructor(name, color) { |
195 | 195 | // this.name = name |
|
262 | 262 | // super(a,b) -> Call Parent Class Constructor |
263 | 263 |
|
264 | 264 |
|
265 | | -// Overridding Constructor |
| 265 | +// Overriding Constructor |
266 | 266 |
|
267 | | -// With A Constructor, Things Are Bit Tricky/ Different. According To The Specifications , If A Class Extendes Another Class And Has No Constructor. Than The Child Class Will Have A Constructor Automatically. -> By Default Its Generated By The JS Engine. |
| 267 | +// With A Constructor, Things Are Bit Tricky/ Different. According To The Specifications , If A Class Extends Another Class And Has No Constructor. Than The Child Class Will Have A Constructor Automatically. -> By Default Its Generated By The JS Engine. |
268 | 268 |
|
269 | 269 | // Default One |
270 | 270 | // constructor(...args){ ---> If there is no constructor in the child class, this is created automatically |
|
323 | 323 |
|
324 | 324 | // Static Method Are Used To Implement Function That Belong To A Class As A Whole. And Not To Any Particular Object. |
325 | 325 |
|
326 | | -// We Can Assign Singal Static Method; |
| 326 | +// We Can Assign Single Static Method; |
327 | 327 |
|
328 | 328 | // Syntax: |
329 | 329 |
|
|
407 | 407 | // console.log(c instanceof Animal) |
408 | 408 |
|
409 | 409 |
|
410 | | -// IntanceOf Operator |
| 410 | +// InstanceOf Operator |
411 | 411 | // InstanceOf Operator Is Used To Check If An Object Is An Instance Of A Class. |
412 | 412 | // Object It Belongs To Certain Class Or Not? |
413 | 413 | // It Return True If Obj Belongs To The Class Or Any Other Class Inherited From It. |
|
0 commit comments