Use this book list to complete the tasks:
library = [
{ title: "Norse Mythology", year: "2017", author: "Neil Gaiman", publisher: "W. W. Norton & Company" },
{ title: "The Old Man and the Sea", year: "1952", author: "Ernest Hemingway", publisher: "Charles Scribner's Sons" },
{ title: "Mythos: A Retelling of the Myths of Ancient Greece", year: "1981", author: "Stephen Fry", publisher: "Penguin" },
{ title: "The Mythical Man-Month", year: "1975", author: "Fred Brooks", publisher: "Addison-Wesley" },
{ title: "The Pragmatic Programmer", year: "1999", author: "Andy Hunt and Dave Thomas", publisher: "The Pragmatic Bookshelf " }
];
Create a function named getBookTitle( index ) that will return the book title at the given index.
Modify the library to add a new book of your choice to the defined library array.
Create a function named addBook( book ) that will add a new book to the library and return the updated library.
Create a function named bookByAuthor() that will sort the book list by author in alphabetic order and return the sorted library.
Create a function named findByTitle( title ) that will return an array of matching books for the searched title. A partial text search is applicable, for example - findByTitle(“man”) should return:
[ { title: "The Old Man and the Sea", year: "1952", author: "Ernest Hemingway", publisher: "Charles Scribner's Sons" }, { title: "The Mythical Man-Month", year: "1975", author: "Fred Brooks", publisher: "Addison-Wesley" } ]