title: get my function to loop through the array
body: <p>Hey guys so I am trying to do something and I am not sure how to go about it. I am working on a site for my fraternity. We have this HUGE array with all the bros info in it. I want a function that will loop through the array. Grab the data from column 2 and then write it to the page. but when it writes it it adds a link to it. my example out put would be. that way it can put all the images on the page.</p>
  
  <p>I am trying to run it in the console but I do not think it is looping through the array and I am not sure what I am doing wrong. Can anyone please advise?</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>function imgTag(data) {
    var url = 'http://fratsite.com/images/'+data[1];
    return "&lt;img src='"+url+"' width='392' height='400' alt='' /&gt;";
  }
  
  var output = document.write(imgTag);
  
  console.log(output.join(''));</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>var foo = new Array();
  foo[0] = ["Brother-0001","0001.jpg"];
  foo[1] = ["Brother-0002","0002.jpg"];
  foo[2] = ["Brother-0003","0003.jpg"];
  foo[3] = ["Brother-0004","0004.jpg"];
  foo[4] = ["Brother-0005","0005.jpg"];
  foo[5] = ["Brother-0006","0006.jpg"];
  foo[6] = ["Brother-0007","0007.jpg"];</code></pre>
  </div>
  </div>
  </p>