odin-default-js-exercises/getTheTitles
Michael Frank ac4d2a94e5 Grammar cleanups, trailing semicolon for function expressions 2021-05-10 20:08:31 +12:00
..
README.md Grammar cleanups, trailing semicolon for function expressions 2021-05-10 20:08:31 +12:00
getTheTitles.js Grammar cleanups, trailing semicolon for function expressions 2021-05-10 20:08:31 +12:00
getTheTitles.spec.js Tweak matchers in removeFromArray, pull pigLatin solution from old branch 2021-04-30 22:12:52 +12: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!