Skip to content

Instantly share code, notes, and snippets.

@elcodabra
Created February 4, 2020 14:06
Show Gist options
  • Select an option

  • Save elcodabra/1596d813036a23a67d6602818ccb4216 to your computer and use it in GitHub Desktop.

Select an option

Save elcodabra/1596d813036a23a67d6602818ccb4216 to your computer and use it in GitHub Desktop.

Revisions

  1. elcodabra created this gist Feb 4, 2020.
    8 changes: 8 additions & 0 deletions Animal.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    export default class Animal {
    constructor(name) {
    this.name = name
    }
    getName() {
    return this.name
    }
    }
    5 changes: 5 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    import Animal from './Animal'

    const cat = new Animal('Барсик')

    console.log(cat.getName()) // Барсик