(public readonly maxSize: number, defaultValue: T)
| 8 | private readonly arr = new Array<T>(); |
| 9 | |
| 10 | constructor(public readonly maxSize: number, defaultValue: T) { |
| 11 | for (let index = 0; index < maxSize; index++) { |
| 12 | this.arr.push(defaultValue); |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | push(data: T) { |
| 17 | if (this.arr.length < this.maxSize) { |