docs: function PermutationIterator() {
      function fact(n) {
          var result = 1;
  
          for (var i = 2; i <= n; i++) {
              result *= i;
          }
  
          return result;
      }
  
      var items = Array.prototype.slice.call(arguments, 0);
  
      this.items = (items.length == 1 && Array.isArray(items[0])) ? items[0] : items;
      this.max = (this.items.length > 0) ? fact(this.items.length) : 0;
      this.reset();
  }