ES6: Create Strings using Template Literals(problem)

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;
  for(let index = 0; index < arr.length;index++){
    console.log(`${arr[index]}`);
  }
  const array = document.createElement('ul');
  array.appendChild("li");
  array = `<li class="text-writing">${arr[0]}</li>
           <li class="text-writing">${arr[1]}</li>
           <li class="text-writing">${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);

This code is not working ,I actually created ul element and appended li to it,iterated through the result.failure object property with for loop and got values ,but passing at interpolation.

Two immediately obvious errors:

  1. You’re trying to re-assign a variable defined with const.
  2. You’re creating an array variable and then trying to override it.