November 2019
Beginner
804 pages
20h 1m
English
The last remaining method is easier to implement.
First, let's again add some validations:
removeBook(collectionIdentifier: string, bookIdentifier: string): void { if (!collectionIdentifier) { throw new Error("The collection identifier is required to remove a book!"); } if(!bookIdentifier) { throw new Error("The book identifier is required to remove a book"); } console.log(`Removing book ${bookIdentifier} which should be part of collection ${collectionIdentifier}`); const existingCollection = this._bookCollections.get(collectionIdentifier); if (!existingCollection) { throw new Error("The collection couldn't be retrieved or we could not get the book details from the view!"); } // Add the rest of the ...
Read now
Unlock full access