Get the Titles!

The Get the Titles! problem is an interesting problem where we have to get the title from a list of books. This is a good exercise for the implementation of arrays and objects.

📝 Tasks:

Given an array of objects that represent books with an author.

const books = [
  {
    title: "Eloquent JavaScript, Third Edition",
    author: "Marijn Haverbeke"
  },
  {
    title: "Practical Modern JavaScript",
    author: "Nicolás Bevacqua"
  }
]
  • [ ] Write a program to create a function getTheTitles that takes the array and returns the array of title and print its value in the console.

💡 Hints:

  • Visit the arrays and objects chapter to understand how the array and object work.

results matching ""

    No results matching ""