Created
February 4, 2020 14:06
-
-
Save elcodabra/1596d813036a23a67d6602818ccb4216 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
export default class Animal { | |
constructor(name) { | |
this.name = name | |
} | |
getName() { | |
return this.name | |
} | |
} |
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
import Animal from './Animal' | |
const cat = new Animal('Барсик') | |
console.log(cat.getName()) // Барсик |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment