odin-default-js-exercises/getTheTitles
Michael Frank 7a001e0fdb run jest-codemods on .spec.js files, move generator-exercises back in 2021-03-03 15:25:29 +13:00
..
README.md add titles exercise 2019-04-11 11:37:33 -05:00
getTheTitles.js add titles exercise 2019-04-11 11:37:33 -05:00
getTheTitles.spec.js run jest-codemods on .spec.js files, move generator-exercises back in 2021-03-03 15:25:29 +13:00

README.md

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!