Skip to content

Instantly share code, notes, and snippets.

@AsaoluElijah
Created December 6, 2019 00:58
Show Gist options
  • Save AsaoluElijah/24442af45357bee538314ae96995cab3 to your computer and use it in GitHub Desktop.
Save AsaoluElijah/24442af45357bee538314ae96995cab3 to your computer and use it in GitHub Desktop.
// 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