I'm planning a class letter:
class Carta {
constructor (el) {
// propriedades imutaveis
this.el = el;
}
// metodos
reconstrutor () {
// propriedades mutaveis
}
isManilha () {
}
desenhar () {
}
apagar () {
}
jogar () {
}
}
Inside the constructor I keep el
which is an html element. And a card game so every round I could delete the old objects and instantiate new ones with new properties, but the el
would have to be passed again. So would it be more correct to use a rebuilding method to just change the required properties or would it be a gambiarra?