Created
April 7, 2020 15:23
-
-
Save jsmanifest/fb4767b9f862d8654902551e31808c4e 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 Frog { | |
constructor(name, gender) { | |
this.name = name | |
this.gender = gender | |
} | |
jump() { | |
console.log('jumped') | |
} | |
} | |
class Toad { | |
constructor(habitat, name, gender) { | |
this.habitat = habitat | |
this.frog = new Frog(name, gender) | |
} | |
} | |
const mikeTheToad = new Toad('land', 'mike', 'male') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment