Tell us what’s happening:
Describe your issue in detail here.
Hi Everyone, I’m not sure what Im doing wrong , I can not pass this test failuresList should be equal to the specified output.
But it works in my console - not sure what I am missing? Your code so far
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 = 0; i < arr.length; i++){
failureItems.push(`<li class = "text-warning">${arr[i]}</li>`);
}
// Only change code above this line
return failureItems;
}
const failuresList = makeList(result.failure);
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36
I would suggest you add a console.log just before the return statement showing you what is actually being returned. Remember, the returned output must be exactly the same as what the instructions are asking for.
Thank you for your help but I think Im still missing something. The only thing I can think of is that it prints the array twice when I console.log it - which Im not sure why its doing that Otherwise it prints exactly what the challenge is asking for.