I don’t know if this is possible, since i've do my best and still can’t resolve it here's my code
class account {
constructor(id){
this.id = id;
this.solde = this.getSolde();
}
async getSolde(){
const result = await con.query('SELECT solde FROM account WHERE id = ?', [this.id])
return result[0];
}
}
When I call getSolde() I’ve either undefined or pending promise with different methods I've tried before, like getter, callback, none seems to work for me, can anyone help me
Thanks in advance