title: looping through 2 arrays
body: <p>I am trying to loop through 2 arrays. The first array is the link name the second array is the links 'a' value. I want to loop through the two arrays attaching the value of the second array to the href of each link that is created / in the first array. This is what I have and it not working for me. </p>
  
  <pre><code>const links = ['Home', 'Contact', 'About'];
  const hrefLinks = ['/', 'contact', 'about'];
  
  for (let i = 0; i &lt; links.length; i++) {
      for (let j = 0; j &lt; hrefLinks.length; i++) {
          if (links.length === hrefLinks.length) {
              const li = document.createElement('li');
              const liLink = document.createElement('a');
              liLink.setAttribute('href', hrefLinks[i]);
              liLink.className = 'Test-Class';
              li.appendChild(liLink);
              li.className = 'nav-link';
              list.appendChild(li);
              li.innerHTML += links[i];
          }
      }
  }
  </code></pre>
  
  <p>I do have it working with one forEach loop but got confused on how I would nest the second forEach;</p>
  
  <pre><code>const links = ['Home', 'Contact', 'About'];
  const hrefLinks = ['/', 'contact', 'about'];
  
   links.forEach(function (link) {
       const li = document.createElement('li');
       const liLink = document.createElement('a');
       li.appendChild(liLink);
       li.className = 'nav-link';
       list.appendChild(li);
       li.innerHTML += link;
   });
  </code></pre>
  
  <p>Is this the proper way of doing this or is there an easier / cleaner way of doing this?</p>