+ this.checkSize(size);
+ this.size = size;
+ if (arguments.length > 1) {
+ this.push(...items);
+ }
+ }
+
+ public push(...items: T[]): number {
+ const length = super.push(...items);
+ if (length > this.size) {
+ super.splice(0, length - this.size);
+ }
+ return this.length;
+ }
+
+ public unshift(...items: T[]): number {
+ const length = super.unshift(...items);
+ if (length > this.size) {
+ super.splice(this.size, items.length);
+ }
+ return this.length;