Last active
September 2, 2020 00:55
-
-
Save konami12/afe21369ed1f62333fefb6c0cdb34bb0 to your computer and use it in GitHub Desktop.
❌ Principio de Responsabilidad Única
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 Pokemon { | |
#name = ""; | |
#type = "" | |
#evolutions = []; | |
constructor(name, type, evolutions) { | |
this.#name = name; | |
this.#type = type; | |
this.#evolutions = evolutions; | |
} | |
get name() { | |
return this.#name; | |
} | |
get type() { | |
return this.#type; | |
} | |
get evolutions() { | |
return this.#evolutions; | |
} | |
saveDateDB(pokemon) { ... } | |
} | |
// Creamos la instacia de la clase pokemon | |
const Eevee = new Pokemon("Eevee", "normal", ["Jolteon", "Vaporeon", "Flareon"]); | |
Eeevee.saveDateDB(Eevee); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment