Hey guys,
I am stuck in this challenge of freecodecamp .
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/create-strings-using-template-literals
Use template literal syntax with backticks to display each entry of the result object’s failure array. Each entry should be wrapped inside an li element with the class attribute text-warning, and listed within the resultDisplayArray.
This is my code:
const result = {
success: ["max-length", "no-amd", "prefer-arrow-functions"],
failure: ["no-var", "var-on-top", "linebreak"],
skipped: ["id-blacklist", "no-dup-keys"]
};
function makeList(arr) {
"use strict";
// change code below this line
const resultDisplayArray = arr.map(val => `<li class="text-warning">${val}</li>`) ;
// change code above this line
return resultDisplayArray;
}
/**
* makeList(result.failure) should return:
* [ <li class="text-warning">no-var</li>,
* <li class="text-warning">var-on-top</li>,
* <li class="text-warning">linebreak</li> ]
**/
const resultDisplayArray = makeList(result.failure);
I realy don’t know what is wrong.