Created
September 22, 2017 16:22
-
-
Save DiegoPinho/2cb6c33e2944875791bde5a74ff7afad 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 Carro { | |
constructor(modelo,marca) { | |
this.modelo = modelo; | |
this.marca = marca; | |
} | |
andar() { | |
console.log('vrum vrum'); | |
} | |
} | |
class ModeloA extends Carro { | |
constructor(modelo, marca, cor) { | |
super(modelo, marca); | |
this.cor = cor; | |
} | |
} | |
const carro = new ModeloA('A', 'Fiat', 'Amarelo'); | |
console.log(carro.modelo, carro.marca, carro.cor); | |
carro.andar(); // vrum vrum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment