Skip to content

Instantly share code, notes, and snippets.

@victorvhpg
Created November 11, 2016 00:49
Show Gist options
  • Select an option

  • Save victorvhpg/abb93d16d657affe1904c8e56a9bc62b to your computer and use it in GitHub Desktop.

Select an option

Save victorvhpg/abb93d16d657affe1904c8e56a9bc62b to your computer and use it in GitHub Desktop.
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