So, here’s the code in question:
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";
const resultDisplayArray = arr.map( (list) =>
`<li class="text-warning">${list}</li>`
);
return resultDisplayArray;
}
const resultDisplayArray = makeList(result.failure);
console.log(resultDisplayArray);
console gives me the desired output.
If I add curly brackets to the fat arrow function, which I’ve seen in numerous examples and in the previous lessons, it gives me a blank, comma-separated list:
const resultDisplayArray = arr.map( (list) => {
`<li class="text-warning">${list}</li>`
}
);
console gives me:
, ,
Can anyone explain to me why this is happening? Thank you.
Jordan