Created
November 11, 2016 00:49
-
-
Save victorvhpg/abb93d16d657affe1904c8e56a9bc62b 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 Retangulo{ | |
| constructor(largura, altura){ | |
| this.largura = largura; | |
| this.altura = altura; | |
| } | |
| getArea(){ | |
| return this.largura * this.altura; | |
| } | |
| } | |
| class Quadrado extends Retangulo{ | |
| constructor(lado) { | |
| super(lado, lado); | |
| this.algumaCoisa = "xxx"; | |
| } | |
| } | |
| //instancia | |
| var objQuadradro = new Quadrado(3); | |
| console.log(objQuadradro.getArea()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment