how to use a setter method inside a class js code example
Example: javascript class setter
const language = {
set current(name) {
this.log.push(name);
},
log: []
}
language.current = 'EN';
language.current = 'FA';
console.log(language.log);