odin-default-js-exercises/getTheTitles
icorvus c09df52d6a fixed semicolon 2022-01-23 20:50:36 +01:00
..
README.md Added jest 2021-05-17 23:46:49 +01:00
getTheTitles.js fixed semicolon 2022-01-23 20:50:36 +01:00
getTheTitles.spec.js Merge branch 'main' into km-testing-jest-2 2021-05-17 18:56:52 -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!