code: function extractPageValues(outerWindow, currentPage, pageStartAtValue, pageEndAtValue) {
    let pageValues = [];
    pageValues.push(pageStartAtValue);
    pageValues.push(pageEndAtValue);
  
    let addPageValue = function(page) {
      pageValues.push(page);
    };
  
    if (outerWindow > 0) {
      let leftOuterWindowStartAtValue = pageStartAtValue + 1;
      let leftOuterWindowEndAtValue = pageStartAtValue + outerWindow;
  
      let rightOuterWindowStartAtValue = pageEndAtValue - 1 - outerWindow;
      let rightOuterWindowEndAtValue = pageEndAtValue - 1;
  
      createRange(leftOuterWindowStartAtValue, leftOuterWindowEndAtValue).forEach(addPageValue);
      createRange(rightOuterWindowStartAtValue, rightOuterWindowEndAtValue).forEach(addPageValue);
    }
  
    // add / subtract 2 for the dots display for the inner window
    // to handle exactly this use case (if 100 is current page): ... 99 100 101 ...
    let innerWindowStartAtValue = currentPage - 2;
    let innerWindowEndAtValue = currentPage + 2;
    createRange(innerWindowStartAtValue, innerWindowEndAtValue).forEach(addPageValue);
  
    let takeUnique = function(page, idx, array) {
      return array.indexOf(page) === idx;
    };
  
    return pageValues
            .sort((a, b) => a - b)
            .filter((page) => page >= pageStartAtValue && page <= pageEndAtValue)
            .filter(takeUnique);
  
  }
docs: TODO: use Set here when time is right, apparently it's not widely supported yet