|  | @@ -10,24 +10,28 @@ function GetAllBooks() {
 | 
	
		
			
				|  |  |        author: 'James Joyce',
 | 
	
		
			
				|  |  |        available: true,
 | 
	
		
			
				|  |  |        category: Category.Fiction,
 | 
	
		
			
				|  |  | +      id: 1,
 | 
	
		
			
				|  |  |        title: 'Ulysses',
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      {
 | 
	
		
			
				|  |  |        author: 'Ernest Hemingway',
 | 
	
		
			
				|  |  |        available: false,
 | 
	
		
			
				|  |  |        category: Category.Fiction,
 | 
	
		
			
				|  |  | +      id: 2,
 | 
	
		
			
				|  |  |        title: 'A farewall to arms',
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      {
 | 
	
		
			
				|  |  |        author: 'Maya Angelou',
 | 
	
		
			
				|  |  |        available: true,
 | 
	
		
			
				|  |  |        category: Category.Poetry,
 | 
	
		
			
				|  |  | +      id: 3,
 | 
	
		
			
				|  |  |        title: 'I know why the caged bird sings',
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      {
 | 
	
		
			
				|  |  |        author: 'Herman Melville',
 | 
	
		
			
				|  |  |        available: true,
 | 
	
		
			
				|  |  |        category: Category.Fiction,
 | 
	
		
			
				|  |  | +      id: 4,
 | 
	
		
			
				|  |  |        title: 'Moby Dick',
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    ];
 | 
	
	
		
			
				|  | @@ -64,11 +68,21 @@ function GetBookTitlesByCategory(categoryFilter: Category): Array<string> {
 | 
	
		
			
				|  |  |    return filteredTitles;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +function GetBookById(id: number) {
 | 
	
		
			
				|  |  | +  const allBooks = GetAllBooks();
 | 
	
		
			
				|  |  | +  return allBooks.filter(book => book.id === id)[0];
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  function LogBookTitles(titles: string[]): void {
 | 
	
		
			
				|  |  |    for (let title of titles) {
 | 
	
		
			
				|  |  |      console.log(title);
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -const poetryBooks = GetBookTitlesByCategory(Category.Poetry);
 | 
	
		
			
				|  |  | -LogBookTitles(poetryBooks);
 | 
	
		
			
				|  |  | +//******************************************************************************
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const fictionBookTitles = GetBookTitlesByCategory(Category.Fiction);
 | 
	
		
			
				|  |  | +// LogBookTitles(fictionBookTitles);
 | 
	
		
			
				|  |  | +fictionBookTitles.forEach((val, idx, arr) => console.log(`${++idx} ${val}.`));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +console.log(GetBookById(2));
 |