I am exporting a class where I do not want the user to be able to access the
name variable. Is there anything wrong with doing it this way from a technical stand point, not personal preference? I know it's probably not a best practice, but it seems to work.
let _name = 'bob';
export default class Person {
getName() {
return _name;
}
setName(name) {
_name = name;
}
}