Created
December 6, 2019 00:58
-
-
Save AsaoluElijah/24442af45357bee538314ae96995cab3 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
// Animal Class | |
class Animal{ | |
// A class method | |
sayHello(){ | |
console.log('Hello World'); | |
} | |
} | |
// Goat class | |
class Cat extends Animal{ | |
favSport(){ | |
console.log('Hacking!') | |
} | |
} | |
// Creating a new object | |
const jira = new Animal; | |
jira.sayHello(); // Hello World | |
jira.favSport(); // Hacking! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment