JavaScript JavaScript Array Iteration Methods Combining Array Methods Working with Objects

Joshua Blalock
Joshua Blalock
8,198 Points

Saying that the correct answer is wrong?

saying "Somethings not right output of fullAuthorNames: ["Beatrix Potter","Ann Martin","Beverly Cleary","Roald Dahl","Lewis Carroll"]". Which is the correct answer...

app.js
const authors = [
  { firstName: "Beatrix", lastName: "Potter" },
  { firstName: "Ann", lastName: "Martin" },
  { firstName: "Beverly", lastName: "Cleary" },
  { firstName: "Roald", lastName: "Dahl" },
  { firstName: "Lewis", lastName: "Carroll" }
];
let fullAuthorNames;

// fullAuthorNames should be: ["Beatrix Potter", "Ann Martin", "Beverly Cleary", "Roald Dahl", "Lewis Carroll"]

// Write your code below

fullAuthorNames = authors.map(aNames =>{
 return fullAuthorNames=(`${aNames.firstName}  ${aNames.lastName}`);

});

1 Answer

Joshua Blalock
Joshua Blalock
8,198 Points

I figured it out I just had 2 spaces in between the names >.>.