// returns an object with closed over properties.functionPerson(name, age) {// 🔸 private properties// • `name`, `age` are treated as private properties.// ⭐️ the object to be returned (with exposed methods)constobj= { sayHi };// -------- define getter/setter/method --------// 🔸 obj.name (getter/setter)Object.defineProperty(obj,'name', {get() { return name },set(value) { name = value }, });// 🔸 obj.sayHi (exposed method)functionsayHi() {console.log(`Hi, my name is ${name}, I'm ${age} years old.`); }return obj;}// instancesconstjoe=Person('Joe',10);constjane=Person('Jane',8);joe.name ='Superman'; // "setter" calledjoe.sayHi(); // Hi, my name is Superman, I'm 10 years old.jane.sayHi(); // Hi, my name is Jane, I'm 8 years old.