test 11 completed

This commit is contained in:
rajroushan6714 2023-08-25 11:31:56 +05:30
parent e5a927b7eb
commit 62ea370b94
1 changed files with 16 additions and 1 deletions

View File

@ -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