debug += concatenate

This commit is contained in:
LoptrSir 2022-04-28 12:15:01 -07:00
parent f42494749e
commit b552c0eabb
1 changed files with 20 additions and 6 deletions

View File

@ -1,8 +1,22 @@
const getTheTitles = function(dict) {
result = Object.keys(dict);
console.log(result);
return result;
// test tested retest
};
const getTheTitles = function (dicts) {
let title = [];
dicts.forEach((dict) => {
for (const ttl in dict) {
if (ttl === "title") title += dict[ttl];
}
});
console.log(title);
};
getTheTitles([
{
title: "Book",
author: "Name",
},
{
title: "Book2",
author: "Name2",
},
]);