function() {
        // remove the next item from the array
        const item = items.pop();

        // we are done if there is no item
        if (!item) {
          return Promise.resolve({ done: true });
        }

        // prompt to delete this item.
        return deleteItem(item, session);
      }
function() {
        
        const item = items.pop();

        
        if (!item) {
          return Promise.resolve({ done: true });
        }

        
        return deleteItem(item, session);
      }
function ( ) { // remove the next item from the array const item = items . pop ( ) ; // we are done if there is no item if ( ! item ) { return Promise . resolve ( { done : true } ) ; } // prompt to delete this item. return deleteItem ( item , session ) ; }
every time we ask for a new item
every time we ask for a new item