Last active
June 15, 2017 00:50
-
-
Save oliyoung/981d01895104a35a42250f3a987ce7fa 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
const data = { name: 'Apple', type: 'Fruit', color: 'red' } | |
class Fruit { | |
constructor(data) { | |
this.data = data | |
} | |
isRed() { | |
this.color === 'red'; | |
} | |
} | |
const apple = new Fruit(data); | |
assert(apple.isRed()); | |
assert(apple.name, 'Apple'); |
sophistifunk
commented
Jun 15, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment