Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Array Iteration Methods Combining Array Methods Working with Objects

Myles Young
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Myles Young
Full Stack JavaScript Techdegree Graduate 22,056 Points

So I have run into another technical issue, but what am I missing? It looks like the expected output to me.

idk

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(author => `${author.firstName}  ${author.lastName} `)

1 Answer

Owa Aquino
Owa Aquino
19,277 Points

Hi Myles,

Now you have too many spaces. Remember that when using template literal spaces are actually not being compiled. So your codes read like this:

["Beatrix  Potter ", "Ann  Martin ", "Beverly  Cleary ", "Roald  Dahl ", "Lewis  Carroll "]

You have two space between the first name and last name, then you have an extra space at the end of their names. Removing this spaces should approve your answer.

Cheers!