/* There are lots of shelves in the library, and they can contain different types of objects. */ export default class Shelf { private _items: Array = new Array(); add(item: T): void { this._items.push(item); } find(title: string): T { return this._items.filter(item => item.title === title)[0]; } getFirst(): T { return this._items[0]; } printTitles(): void { this._items.forEach(item => console.log(item.title)); } }