Skip to content

Instantly share code, notes, and snippets.

@HashRaygoza
Created May 22, 2020 21:01
Show Gist options
  • Select an option

  • Save HashRaygoza/81ef58fc8f64c13fb2c298756fa2d04d to your computer and use it in GitHub Desktop.

Select an option

Save HashRaygoza/81ef58fc8f64c13fb2c298756fa2d04d to your computer and use it in GitHub Desktop.
Clase contador.js en forma de módulo
class Contador {
constructor(tArea) {
this.conteo = 0;
this.texto = tArea;
}
incrementar() {
console.log("Incrementar");
this.conteo++;
var texto = this.texto.value;
texto = texto + this.conteo + "\n";
this.texto.value = texto;
}
decrementar() {
this.conteo--;
var texto = this.texto.value;
texto = texto + this.conteo + "\n";
this.texto.value = texto;
}
}
export { Contador };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment