Question 8
Consider the following JavaScript code.
const library = { name: "Central Library", books: [ { title: "Book A", author: "Author A" }, { title: "Book B", author: "Author B" }, { title: "Book C", author: "Author C" }, ], location: "IIT Madras",};
let propertyList = "";let bookDetails = "";
for (let key in library) { if (key === "books") { for (let book of library[key]) { bookDetails += `${book.title} by ${book.author}, `; } } else { propertyList += key + " "; }}
console.log(propertyList);console.log(bookDetails);What will be the output of the above code snippet on the console of the browser?