Skip to content

Instantly share code, notes, and snippets.

@Damimd10
Created March 24, 2019 03:45
Show Gist options
  • Save Damimd10/f8d07580cadc4de6d42675be278077ea to your computer and use it in GitHub Desktop.
Save Damimd10/f8d07580cadc4de6d42675be278077ea to your computer and use it in GitHub Desktop.
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