Tell us what’s happening:
resultDisplayArray
should be an array containing
result failure
messages.
resultDisplayArray
should be equal to the specified output. Template strings and expression interpolation should be used. An iterator should be used. // tests completed // console output [ ‘
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";
// Only change code below this line
const resultDisplayArray = `[
'<li class="text-warning">${arr[0]}</li>',
'<li class="text-warning">${arr[1]}</li>',
'<li class="text-warning">${arr[2]}</li>'
]`;
// Only change code above this line
console.log(resultDisplayArray);
return resultDisplayArray;
}
const resultDisplayArray = makeList(result.failure);
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
.
Challenge: Create Strings using Template Literals
Link to the challenge: