2
I’m planning a letter class:
class Carta {
constructor (el) {
// propriedades imutaveis
this.el = el;
}
// metodos
reconstrutor () {
// propriedades mutaveis
}
isManilha () {
}
desenhar () {
}
apagar () {
}
jogar () {
}
}
Inside the builder I keep el
which is an html element. And a card game so every round I could erase the old objects and instantiate new ones with new properties, but the el
would have to be passed again. So it would be more correct to use a reconstructor method to just change the required properties or it would be a gambiarra?
I don’t know what you want, but I imagine it’s at least inventive.
– Maniero
was exactly what I wanted to know, to know if I’m on the right track or not and I’ve seen that not, what to have php as the first language.
– user83428
If the letter object will be "reset" - a new card, I think I could use only the constructor. Unless only properties of the same letter will be changed, for example, it be manila at a certain time and not be more at another time.
– BrTkCa