Create Strings using Template Literals NEW

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 = arr.map((item) => {
        return `<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>` ]
 **/

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36.

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

Guys, why in the console:

// running tests
resultDisplayArray is not defined
// tests completed

Help me please !!!

Sorry for clogging the forum, but I can’t solve the task in any way.

I think you accidentally deleted this final line in the challenge:

const resultDisplayArray = makeList(result.failure);

When everything’s in place, your solution works just fine; but as soon as I remove the line above, it gives the same error as the one you provided.

Thank you thank you thank you. Happened ))

1 Like