Last active
April 4, 2023 08:11
-
-
Save Hurly77/aeda344009fdb949f9ab7add1828d19e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bird { | |
layEgg () {} | |
} | |
class FlyingBird { | |
fly () {} | |
} | |
class SwimmingBird extends Bird { | |
swim () {} | |
} | |
class Eagle extends FlyingBird {} | |
class Penguin extends SwimmingBird {} | |
const penguin = new Penguin(); | |
penguin.swim(); | |
penguin.layEgg(); | |
const eagle = new Eagle(); | |
eagle.fly(); | |
eagle.layEgg(); |
I think so too. It seems on line 5 it should have been like this:
class FlyingBird extends Bird {
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
line 23: eagle.layEgg(); <== how is that even possible since class Eagle extends FlyingBird {} and FlyingBird class does not extend Bird ?