title: Can I use a functions argument as the prefix for a variable name? myFunction(id) { idvarName}
body: <p>Edit: what worked for me (as was suggested) was to use the arrays as arguments in the function call...</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let navText = ['House', 'Food', 'Work'];
  let navLinks = ['house.html', 'food.html', 'work.html'];
  
  
  
  
  
  function navBuilder(id, textList, linkList) {
  
    // Getting the element with the id
    navList = document.getElementById(id);
    // let openTag = document.innerHTL
  
    // looping through the arrays and matching the text with the link
    for (let i = 0; i &lt; textList.length; i++) {
  
      listItem = document.createElement('li');
      // adds classes
      listItem.className = id + '_list_item';
      linkClass = id + "_list_link";
      // put it all together
      listItem.innerHTML += "&lt;a href=\"" + linkList[i] + "\" class=\"" + linkClass + "\"&gt;" + textList[i] + "&lt;/a&gt;&lt;/li&gt;";
      navList.appendChild(listItem);
    }
  
  }
  // Call the function here or include it in a script tag at the end of the html.
  navBuilder("nav", navText, navLinks);</code></pre>
  </div>
  </div>
  </p>
  <p>Thanks for the help!</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let navText = ['House', 'Food', 'Work'];
  let navLinks = ['house.html', 'food.html', 'work.html'];
  
  
  
  
  
  function navBuilder(id, textList, linkList) {
  
    // Getting the element with the id
    navList = document.getElementById(id);
    // let openTag = document.innerHTL
  
    // looping through the arrays and matching the text with the link
    for (let i = 0; i &lt; textList.length; i++) {
  
      listItem = document.createElement('li');
      // adds classes
      listItem.className = id + '_list_item';
      linkClass = id + "_list_link";
      // put it all together
      listItem.innerHTML += "&lt;a href=\"" + linkList[i] + "\" class=\"" + linkClass + "\"&gt;" + textList[i] + "&lt;/a&gt;&lt;/li&gt;";
      navList.appendChild(listItem);
    }
  
  }
  // Call the function here or include it in a script tag at the end of the html.
  navBuilder("nav", navText, navLinks);</code></pre>
  </div>
  </div>
  </p>
  <p>It was just a slight modification to what I was doing to begin with. It was for sure a x and y problem</p>