odin-default-js-exercises/getTheTitles
Marvin Gay 8430e59fe4 Merge branch 'origin/master' into 'jest' 2021-05-12 21:45:11 -04:00
..
README.md Update exercise number of each exercise 2021-05-12 19:39:31 +12:00
getTheTitles.js added trailing semicolon to all function and module exports 2021-05-10 21:27:55 +12:00
getTheTitles.spec.js Merge branch 'origin/master' into 'jest' 2021-05-12 21:45:11 -04: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!