2021-05-12 09:37:19 +00:00
|
|
|
# Exercise 11 - Get the Titles!
|
2019-04-11 16:37:33 +00:00
|
|
|
|
|
|
|
You are given an array of objects that represent books with an author and a title that looks like this:
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
const books = [
|
|
|
|
{
|
|
|
|
title: 'Book',
|
|
|
|
author: 'Name'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Book2',
|
|
|
|
author: 'Name2'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
```
|
|
|
|
|
2021-05-10 08:08:31 +00:00
|
|
|
Your job is to write a function that takes the array and returns an array of titles:
|
2019-04-11 16:37:33 +00:00
|
|
|
|
|
|
|
```javascript
|
|
|
|
getTheTitles(books) // ['Book','Book2']
|
|
|
|
```
|
|
|
|
|
|
|
|
## Hints
|
|
|
|
|
|
|
|
- You should use a built-in javascript method to do most of the work for you!
|