Template litteral challenge - Can't validate the use of templates

Template litteral challenge - Can't validate the use of templates
0

#1

Tell us what’s happening:
error : can’t validate “Template strings were used”
I must say I found this challenge pretty confusing, As far as I know, the solution I proposed does use templates litteral to solve the challenge, and the log tells me my string is the same as the one that’s supposed to be output. I’m not too familiar with templates litteral, so I might have missed something, if it is the case please let me know, as I fail to understand what’s wrong with my code :confused:

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

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


#2

#3

Well I shall try with map then.
Thanks !


#4

It will not make any difference. Even using map still will not pass. There is a new bug in the fix tried to fix the original bug.