I have a problem with my code. I want to display 3 times
What are my mistakes and how can I solve this challenge!?
My 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
for (let i = 0; i <= result['failure'].length; i++) {
return [`<li class="text-warning">${result.failure[i]}</li>`];
}
// Only change code above this line
return arr;
}
const failuresList = makeList(result.failure);
console.log(failuresList);
My output is [ '<li class="text-warning">no-var</li>' ]
. But the challenge tell my to return => [ '<li class="text-warning">no-var</li>', '<li class="text-warning">var-on-top</li>', '<li class="text-warning">linebreak</li>' ]
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:81.0) Gecko/20100101 Firefox/81.0
.
Challenge: Create Strings using Template Literals
Link to the challenge: