// inheritance = allows a new class to inherit properties and methods // from an existing class (parent -> child) // helps with code reusability class Animal{ alive = true; eat(){ console.log(`This ${this.name} is eating`); } sleep(){ console.log(`This ${this.name} is sleeping`); } } class Rabbit extends Animal{ name = "rabbit"; run(){ console.log(`This ${this.name} is running`); } } class Fish extends Animal{ name = "fish"; swim(){ console.log(`This ${this.name} is swimming`); } } class Hawk extends Animal{ name = "hawk"; fly(){ console.log(`This ${this.name} is flying`); } } const rabbit = new Rabbit(); const fish = new Fish(); const hawk = new Hawk(); console.log(rabbit.alive); rabbit.eat(); rabbit.sleep(); rabbit.run();
@ArinAkaMazu11 ай бұрын
Yo bro seriously how do you manage to be such a goat like lord I fricking love your tutorials you make everything look so easy
@hamedalwafi87178 ай бұрын
True ! god bless
@SuperFastJewJitsu11 ай бұрын
Don't have time to watch as I'm heading out but had to instalike, Keep at it bro.
@KarthickRajendran-y2v6 күн бұрын
Excellent tutorial. Thanks for sharing
@piotrmazgaj2 ай бұрын
This is my seal. I have watched the entire video, understood it, and I can explain it in my own words, thus I have gained knowledge. This is my seal.
@manojpatra44584 ай бұрын
Nice explanation. However, I wonder why you didn't use constructor in any of the classes. Will anything get changed with constructors in inheritance?
@SimpleAverageBoi6911 ай бұрын
Bro bro bro u a legend ❤❤❤❤❤❤❤
@speroakpo463010 ай бұрын
Amazing job man!
@Gigglesaintlame Жыл бұрын
❤ waiting for more videos Bro(fourth day)
@realitybeckons412011 ай бұрын
Thank you
@Not-Roys-Horse3 күн бұрын
"They're eating the dogs. They're eating the cats"
@sanjay99709 ай бұрын
excellent explanation
@navnitkhandait67508 ай бұрын
really a true bro code
@malikgulraiz365911 ай бұрын
We want react js tutorials 👇
@miranda49236 ай бұрын
Very much good 😂!
@helioobianchi7 ай бұрын
I'm wondering if dev tools have validation features for code inconsistencies like calling a method that doesn't exist or trying to use an unexisting variable/attribute (is there a vscode extension for this?). in Java for example those are detected in compile time, i.e. you need to fix them to get to run the code (the IDE also warns about them to help save time)
@RedHeadphones11 ай бұрын
bro, can you make a video on hashmaps
@Abde4736 ай бұрын
thanks bro 😂
@PrAvEeN.__.11 ай бұрын
Bro make a tutorial to download the Java for full stack developer in laptop Asking for sis
@KD-tp6er16 күн бұрын
I'm learning JS, and thought you needed to use constructors within classes to define properties, am I missing something?