const language = {
set current(name) {
this.log.push(name);
},
log: []
};
language.current = 'EN';
language.current = 'FA';
console.log(language.log);
The above code and below code works the same. Or is there any use cases where the output will be different?
const language = {
log: []
};
language.log.push('EN');
language.log.push('FA');
console.log(language.log);