Last active
May 6, 2018 17:00
-
-
Save olddustysocksunderthecouch/c2a11b2c907aec94152e031cec9a50c6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Human{ | |
species = ‘human’; | |
} | |
const person = new Person(); | |
class Person extends Human{ | |
name = ‘Douglas Adams’; | |
printAuthorsName = () => { | |
console.log(this.name); | |
} | |
const person = new Person(); | |
person.printAuthorsName(); // prints 'Douglas Adams' | |
console.log(person.species); // prints ’human’ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment