ES6 - Create Strings using Template Literals

Tell us what’s happening:
Describe your issue in detail here.
hi everyone im stuck please help maybe its something in front of me failurelist is not equal to the specified output.

Your code so far

const result = {
  success: ["max-length", "no-amd", "prefer-arrow-functions"],
  failure: ["no-var", "var-on-top", "linebreak"],
  skipped: ["no-extra-semi", "no-dup-keys"]
};
function makeList(arr) {
  // Only change code below this line
  const failureItems = [];
  for (let i = 0; i < arr.length; i++) {
    console.log(arr[i])
    let str ='<li class="text-warning">${arr[i]}</li>'
    failureItems.push(str)  
  }
  // Only change code above this line

  return failureItems;
}

const failuresList = 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/113.0.0.0 Safari/537.36 Edg/113.0.1774.35

Challenge: ES6 - Create Strings using Template Literals

Link to the challenge:

Your solution is almost correct.
However you’ve missed the critical distinction between single quote marks and backticks.
Using single quotes, you have simply created a string.
Template literal requires backticks, in order to interpolate variables into a string.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.