test 11 completed
This commit is contained in:
parent
e5a927b7eb
commit
62ea370b94
11_getTheTitles
|
@ -1,5 +1,20 @@
|
|||
const getTheTitles = function() {
|
||||
const getTheTitles = function(books) {
|
||||
//Solution 1:
|
||||
//return books.map((book) => book.title);
|
||||
|
||||
// Solution 3:
|
||||
return books.map(myFunction);
|
||||
function myFunction(book){
|
||||
return book.title;
|
||||
}
|
||||
|
||||
// Solution 2:
|
||||
// let res = [];
|
||||
// let n = books.length;
|
||||
// for(let i = 0 ; i< n ;i++){
|
||||
// res[i] = books[i].title;
|
||||
// }
|
||||
// return res;
|
||||
};
|
||||
|
||||
// Do not edit below this line
|
||||
|
|
Loading…
Reference in New Issue