code: function TaskQueue(array) {
    array = array || [];
    if (!Array.isArray(array)) throw new Error('TaskQueue parameter must be an array.');
    else {
      this.taskQueue = array;
      this.length = array.length;
      this.index = 0;
    }
  }
docs: ***** TaskQueue constructor *****