function dequeue(from, to) {
  from = from + 1;
  const count = (to - (from - 1));
  for (let ii = count; ii > 0; --ii) {
    const idx = from + ii - 1;
    const cmd = this.stack[idx];
    const kind = this.getCommandKind(cmd);
    switch (kind) {
      case CommandKind.BATCH_OPERATION:
        cmd.batch.kill();
      break;
      case CommandKind.LAYER_OPERATION:
        if (cmd.kind === CommandKind.LAYER_MERGE) {
          cmd.batch.data.kill();
        }
      break;
    };
    this.stack.splice(idx, 1);
  };
}
Dequeue items from stack
@param {Number} from
@param {Number} to