Need explanation, Create Strings using Template Literals

Why is a need to

const resultDisplayArray = makeList(result.failure); ?

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 = []; // I get that we need to create a blank array to output.
  for (let i=0; i< arr.length; i++) { // The loop to look through the object.
    resultDisplayArray.push(`<li class="text-warning">${arr[i]}</li>`); // This to push the protpertyy requested by the function parameter.
  // change code above this line

  return resultDisplayArray; // This will return the  request poperty.
 * 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);//** THE CONFUSING part is this. Why do I need to assign the functon to this varible? */



The variable inside the function could be named differently. The one at the bottom has to be named resultDisplayArray for the test.

I found it a bit odd too. Maybe there is some best practice behind this way of naming things and someone else could elaborate …