odin-js-fundamentals-part-5/11_getTheTitles
NetMan d8d93e38e0 Passed test (all) in exercise 11 2024-01-11 21:44:48 +01:00
..
solution Initial commit 2024-01-11 09:52:05 +01:00
README.md Initial commit 2024-01-11 09:52:05 +01:00
getTheTitles.js Passed test (all) in exercise 11 2024-01-11 21:44:48 +01:00
getTheTitles.spec.js Initial commit 2024-01-11 09:52:05 +01:00

README.md

Exercise 11 - Get the Titles!

You are given an array of objects that represent books with an author and a title that looks like this:

const books = [
  {
    title: 'Book',
    author: 'Name'
  },
  {
    title: 'Book2',
    author: 'Name2'
  }
]

Your job is to write a function that takes the array and returns an array of titles:

getTheTitles(books) // ['Book','Book2']

Hints

  • You should use a built-in javascript method to do most of the work for you!