Understanding hint in "Create Strings using Template Literals" task

Hello!

I will dive right into it. This is the topic: freeCodeCamp Challenge Guide: Create Strings using Template Literals

Hint says:

  • Iterate through each element of arr and add a new element consisting composed of a template literal using arr’s elements to create the array failureItems.

I am not a native speaker so I cannot wrap my head around the sentence. Are both “consisting” and “composed” should be in the sentence or one of them is unnecessary?

Thanks in advance!

Well, I am a native speaker and that is a confusing sentence for me. I think it should be one or the other, either:

… add a new element consisting of a template literal…

or

… add a new element composed of a template literal…

I think those mean roughly the same thing. I think putting both in was an editing error.

1 Like

With speedy service like that, someone’s getting a tip… :wink:

hello!
I am trying to solve it using for-of loop but it’s not working .Need help

const result = {
success: [“max-length”, “no-amd”, “prefer-arrow-functions”],
failure: [“no-var”, “var-on-top”, “linebreak”],
skipped: [“no-extra-semi”, “no-dup-keys”]
};
function makeList(arr) {
// Only change code below this line
const failureItems = ;

for(let i in arr){
failureItems.push(<li class="text-warning">${arr[i]} </li>);
}
// Only change code above this line

return failureItems;
}

const failuresList = makeList(result.failure);

"failuresList should be equal to the specified output."

Welcome to the forum.

We like to keep threads from getting too big and branching out too much. Please create a separate thread and provide a link to the challenge.

how do I create separate thread? guide please

Back out to the main screen and look for the “+ New Topic” button in the upper right.

Or, a better way if you are asking about a curriculum challenge… Go to that challenge, look for the “Get Help” button in the lower left. In that, go Get Help -> Ask for Help - that will copy your code and give a link to the challenge, making it easy for us to help you.

1 Like

You are using a for...in not for...of they are not the same.

Anyway, you have a space inside the li text content that isn’t supposed to be there.

My query is it’s working in editor but in challenge its showing an error don’t know why and yeah I was talking about for-in that was just typing mistake SORRY for that

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.