Suggestion for "Create Strings using Template Literals" lesson

Suggestion for "Create Strings using Template Literals" lesson
0.0 0

#1

Tell us what’s happening:
This code wasn’t letting me pass the lesson even though it does everything that was asked. So I looked for help here on the forum and saw that I was supposed to use the map method. That’s pretty annoying considering the lesson never said we’re supposed to use the map method and my code below does exactly what the lesson asks.

I understand that using the map method is arguably the best way to complete the problem but having a hidden testing criteria is just plain frustrating. I can also understand that it can teach people to use the Read-Search-Ask method when they’re completely stuck on a problem but I don’t think people who are learning should get stuck because the site teaching them didn’t give complete instructions.

I really think they should either change the lesson description so it explicitly says we have to use the map method or change the testing criteria so that the code I have below passes. I spent much too long trying to figure out what I was doing wrong only to find out the lesson didn’t give me complete instructions.

Yeah I’m being pretty whiny but I truly believe this is a valid complaint.

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 = [`<li class="text-warning">${arr[0]}</li>`,
  `<li class="text-warning">${arr[1]}</li>`,
  `<li class="text-warning">${arr[2]}</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 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0.

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