Create Strings using Template Literals(Challenge)

Tell us what’s happening:

My OUTPUT is :

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

But when i Run all the tests I only pass one test i.e. :

Template strings were used

and no other tests become true.

Could anybody suggest something?

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
  let resultDisplayArray = ["no-var", "var-on-top", "linebreak"] 

  resultDisplayArray = resultDisplayArray.map(resultDisplayArray => `<li class="text-warning">${resultDisplayArray}</li>`)
  // change code above this line

  console.log(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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36.

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

Hi,
First off, don’t forget to write semi-colons at the end of expressions.
Why are you creating resultDisplayArray variable? You already have the array from result object, whose key test provides as an argument to the function makeList(arr).
The only reason you don’t pass tests is that you don’t return anything from a function, you just console.log() it.