Factory Functions & Singleton Pattern

What advantage does this factory implementation provide?
const createPerson = (() => {
  let peopleCount = 0;
  
  return (name, age) => {
    peopleCount++;
    
    return {
      name,
      age,
      id: peopleCount,
      getDetails() {
        return `${name}, ${age} years old, ID: ${peopleCount}`;
      }
    };
  };
})();
Next Question (28/32)