function FixedStack(ArrayClass, capacity) {

  if (arguments.length < 2)
    throw new Error('mnemonist/fixed-stack: expecting an Array class and a capacity.');

  if (typeof capacity !== 'number' || capacity <= 0)
    throw new Error('mnemonist/fixed-stack: `capacity` should be a positive number.');

  this.capacity = capacity;
  this.ArrayClass = ArrayClass;
  this.items = new this.ArrayClass(this.capacity);
  this.clear();
}
FixedStack

@constructor
@param {function} ArrayClass - Array class to use.
@param {number}   capacity   - Desired capacity.