Created
May 22, 2020 21:01
-
-
Save HashRaygoza/81ef58fc8f64c13fb2c298756fa2d04d to your computer and use it in GitHub Desktop.
Clase contador.js en forma de módulo
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 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