ES6 - Create Strings using Template Literals

here is my code ragarding template literal challenge it’s working in editor but in challenges its showing error
failuresList should be equal to the specified output.
I can’t find the reason need help .

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 in arr){
      failureItems.push(`<li class="text-warning>${arr[i]} </li>`);
  // Only change code above this line

  return failureItems;

const  failuresList =  makeList(result.failure);

To display your code in here you need to wrap it in triple back ticks. On a line by itself type three back ticks. Then on the first line below the three back ticks paste in your code. Then below your code on a new line type three more back ticks. The back tick on my keyboard is in the upper left just above the Tab key and below the Esc key. You may also be able to use Ctrl+e to automatically give you the triple back ticks while you are typing in the this editor and the cursor is on a line by itself. Alternatively, with the cursor on a line by itself, you can use the </> button above the editor to add the triple back ticks.

1 Like

You still have a space inside the element at the end.

<li class="text-warning>${arr[i]} </li>

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