mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-07-16 13:13:19 +09:00
@@ -1,4 +1,4 @@
|
||||
# Exercise 11 - Get the Titles!
|
||||
# Get the Titles!
|
||||
|
||||
You are given an array of objects that represent books with an author and a title that looks like this:
|
||||
|
||||
@@ -15,7 +15,7 @@ const books = [
|
||||
]
|
||||
```
|
||||
|
||||
Your job is to write a function that takes the array and returns an array of titles:
|
||||
your job is to write a function that takes the array and returns an array of titles:
|
||||
|
||||
```javascript
|
||||
getTheTitles(books) // ['Book','Book2']
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const getTheTitles = function() {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = getTheTitles;
|
||||
|
||||
@@ -12,7 +12,7 @@ describe('getTheTitles', function() {
|
||||
}
|
||||
]
|
||||
|
||||
test('gets titles', () => {
|
||||
it('gets titles', function() {
|
||||
expect(getTheTitles(books)).toEqual(['Book','Book2']);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user