function GetAllBooks() { let books = [ { author: 'James Joyce', available: true, title: 'Ulysses', }, { author: 'Ernest Hemingway', available: false, title: 'A farewall to arms', }, { author: 'Maya Angelou', available: true, title: 'I know why the caged bird sings', }, { author: 'Herman Melville', available: true, title: 'Moby Dick', } ]; return books; } function LogFirstAvailable(books): void { const numberOfBooks: number = books.length; let firstAvailable: string = ''; for (let currentBook of books) { if (currentBook.available) { firstAvailable = currentBook.title; break; } } console.log(`Total number of books: ${numberOfBooks}.`); console.log(`First available: ${firstAvailable}.`); } const allBooks = GetAllBooks(); LogFirstAvailable(allBooks);