Created
March 24, 2019 03:45
-
-
Save Damimd10/f8d07580cadc4de6d42675be278077ea 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
class Heroe { | |
constructor(name, isFromDC) { | |
this.name = name; | |
this.isFromDC = isFromDC; | |
} | |
info() { | |
console.log(`${this.name} is ${this.isFromDC ? '' : 'not '} from DC`) | |
} | |
} | |
const batman = new Heroe('Batman', true) | |
const hulk = new Coffee('Hulk', false) | |
batman.info() // Batman is from DC | |
hulk.info() // Hulk is not from DC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment