Factory & Constructor Functions

What's the primary advantage of this abstract factory implementation?
const UIFactory = (theme) => {
  const themes = {
    light: {
      createButton: (text) => ({
        text,
        background: 'white',
        color: 'black'
      }),
      createInput: (placeholder) => ({
        placeholder,
        background: 'white',
        border: '1px solid black'
      })
    },
    dark: {
      createButton: (text) => ({
        text,
        background: 'black',
        color: 'white'
      }),
      createInput: (placeholder) => ({
        placeholder,
        background: 'black',
        border: '1px solid white'
      })
    }
  };
  
  return themes[theme] || themes.light;
};
Next Question (16/20)