mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
Add solution directories for exercises
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
const getTheTitles = function (array) {
|
||||
return array.map((book) => book.title);
|
||||
};
|
||||
|
||||
module.exports = getTheTitles;
|
||||
@@ -0,0 +1,18 @@
|
||||
const getTheTitles = require('./getTheTitles-solution');
|
||||
|
||||
describe('getTheTitles', () => {
|
||||
const books = [
|
||||
{
|
||||
title: 'Book',
|
||||
author: 'Name',
|
||||
},
|
||||
{
|
||||
title: 'Book2',
|
||||
author: 'Name2',
|
||||
},
|
||||
];
|
||||
|
||||
test('gets titles', () => {
|
||||
expect(getTheTitles(books)).toEqual(['Book', 'Book2']);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user