Class(function(extend, using, self){
  var arr = [];
  var index = -1;

    self.add = function (key) {
    if(!key){
      return false;
    }

    if (arr.length > 100) {
      arr.splice(50);
    }

    arr.forEach(function (v, i) {
      if (v === key) {
        arr.splice(i, 1);
      }
    });

    arr.unshift(key);

    index = -1;

    return true;
  };

  self.get = function (pos) {
    if (pos) {
      if (arr[index + 1]) {
        return arr[++index];
      }
    } else {
      if (arr[index - 1]) {
        return arr[--index];
      }
    }
    return '';
  };

  self.clear = function () {
    arr = [];
    index = -1;
  };
  self.func(function(){

  })
});