Last active
July 18, 2018 23:53
-
-
Save caiogranero/131e494244df30065f45bbc5926fa5fb 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 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