Struggling with linked problem

is what i have attempted
why does failureItems stay empty

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 < result.failure.length; i++ ){
    let item = `<li class="text-warning">${result.failure[i]}</li>`
    console.log(result.failure[i])

    failureItems.push[item]
          console.log(failureItems)

  }
  // Only change code above this line

  return failureItems;
}

const failuresList = makeList(result.failure);

It’s a typo somewhere at the end of your function…the rest of code is fine but you could replace result.failure with arr.it’s given as a parameter

push is a method/function. How do you call a function and pass an argument to it?

1 Like

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