()Need help it says that the resultDisplayArray should show the output. Where am i going wrong (Create Strings using Template Literals

Tell us what’s happening:

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 = result.failure.map((arc, item, i) => {
    return `${arc}
    <li class = "text-warning">${item}</li>
    `
  }, ``);
  // change code above this line

  return resultDisplayArray;
}
/**
 * makeList(result.failure) should return:
 * [ `<li class="text-warning">no-var</li>`,
 *   `<li class="text-warning">var-on-top</li>`, 
 *   `<li class="text-warning">linebreak</li>` ]
 **/
const resultDisplayArray = makeList(result.failure);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/create-strings-using-template-literals

Here is what your code is returning:

no-var
    <li class = "text-warning">0</li>
    ,var-on-top
    <li class = "text-warning">1</li>
    ,linebreak
    <li class = "text-warning">2</li>

The first argument of the Array.map() method is the current item, and the second argument is the current item’s index; you have them backwards (see documentation here). The item’s index isn’t needed for this challenge, and is an optional argument, so try doing it without that.

Edit: Also, the result.failure array is passed to the makeList function you’re working within as arr, so you should use that instead of result.failure when assigning const resultDisplayArray