Skip to content

Instantly share code, notes, and snippets.

@caiogranero
Last active July 18, 2018 23:53
Show Gist options
  • Save caiogranero/131e494244df30065f45bbc5926fa5fb to your computer and use it in GitHub Desktop.
Save caiogranero/131e494244df30065f45bbc5926fa5fb to your computer and use it in GitHub Desktop.
class User {
constructor(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
getFullName() {
console.log(this.firstName + " " + this.lastName);
}
}
class Aluno extends User {
constructor(firstName, lastName, turma) {
super(firstName, lastName);
this.turma = turma;
}
}
const aluno = new Aluno("Jon", "Snow", "014")
console.log(aluno.getFullName()); // "Jon Snow"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment