I have this following javascript class:
class Usuario {
constructor() {
this._nome = '';
this._idade = '';
}
get nome() {
return this._nome;
}
set nome( value ) {
this._nome = value;
}
get idade() {
return this._idade;
}
set idade( value ) {
this._idade = value;
}
}
When I return it via json
, it returns the names with _
at startup. I know this sign means that the attribute can only be used within the class itself, so I would like to return the attribute names without this character.