Factory Functions & Singleton Pattern

Which design pattern does this code implement?
const Database = (() => {
  let instance;
  
  function createInstance() {
    const object = new Object({
      data: [],
      add(item) {
        this.data.push(item);
      },
      remove(index) {
        this.data.splice(index, 1);
      }
    });
    return object;
  }
  
  return {
    getInstance: () => {
      if (!instance) {
        instance = createInstance();
      }
      return instance;
    }
  };
})();
Next Question (6/32)