Why we use this arr.map(element => <li class="text-warning">${element}</li>
);
instead of this arr.failure.map(element => <li class="text-warning">${element}</li>
);
How the computer gonna know that we wanna display the elements of failure not other elements in ${element}
Your code so far
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.failure.map(element => `<li class="text-warning">${element}</li>`);
// change code above this line
return resultDisplayArray;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
.
Link to the challenge: