Tell us what’s happening:
The function prints out the failure strings from the array, but not in separate lines like the question wants. I felt the for loop was too easy so I tried recursion and tried googling my problem but I could not really find anything.
**Your 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
const failureItems = [];
if(failureItems < 0){
return [];
}
else{
failureItems.push(`<li class="text-warning">${arr}</li`);
console.log(failureItems);
};
// Only change code above this line
return failureItems;
}
const failuresList = makeList(result.failure);
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
Hey @Goob, the point of this exercise isn’t to print out the strings to the console, it’s to create a function that returns an array of string:
“The makeList function should return the array of list item strings.”
So I would concentrate on that instead. Also, a recursive function calls itself, so you would need to make a call to makeList inside of the makeList function. You can definitely use recursion here if you want, but you need to concentrate on building up the array you are going to return.