Well, youâre right, itâs not so easy to understand^^
What youâre supposed to do is to add the code which will return the commented output below when you pass to the function the argument result.failure.
The output looks like you have the same string (<li class="text-warning">xxx</li>) repeated with a different element inside it (xxx) - actually with each element of the argument array.
So, what the challenge expect you to do is to find a way to iterate over the array to get each element of the array itself and put it dinamically into that ârepeated stringâ.
If this doesnât help feel free to ask again^^
Good luck!
Hi,
The space between class and = probably is the reason for failing one of the tests. Not sure about the other one though. You clearly used template strings.
EDIT: I think your logic is perfectly valid but maybe the testing logic is flawed. After researching this some more it appears that the test chokes on any use of template strings that employ bracket notation in a loop.
You can try some array methods like forEach or map to avoid this or change your loop to not use bracket notation with forâŚof loop
for(let errorMessage of arr){
resultDisplayArray.push(`<li class="text-warning">${errorMessage}</li>`);
}