ES6: Create Strings using Template Literals Challenge

Hi guys, I am stuck on ES6: Create Strings using Template Literals
Can’t seem to get pass resultDisplayArray is the desired output. test

My 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(function(item){
   `<li id="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_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36.

Link to the challenge:

  1. You need to return the string inside map.

  2. It is a class not an id.

  3. You have a space before the item variable.

Looks fine to me, not sure why it isn’t working. Although your code needs return statement in the map function, that should make it return the lists instead if undefined. But not sure why the test isn’t passing

Your template string looks fine, but few things aren’t,

  1. class=‘text-warning’ not id=‘text-warning’
  2. When map function runs it creates the template string but then? you have to return the template string. I am sure you know which keyword is used to “return” something from a function