title: Location names in google maps using loops
body: <p>I'm writing a code that will plot multiple locations on a map using google's api. The coordinates, name and MMSI number is stored on an XML file and is imported in a javascript.</p>
  
  <p>This is the part of code I'm talking about:</p>
  
  <pre><code>    for(i=0; i&lt;x; i++)
        {
        var locations = [
          ['MMSI', 50.26835, 50.45563, 1],
          ['MMSI', 50.29435, 50.44523, 2],
          ['MMSI', 50.09399, 50.40548, 3]
         }
  </code></pre>
  
  <p>What I would like to do is add <code>i</code> to the end of <code>'MMSI'</code> and turn it into a variable which is predefined above. </p>
  
  <p>So what is written above the first code is:</p>
  
  <pre><code>    var MMSI1 = 163474;
      var MMSI2 = 209483;
      var MMSI3 = 705245;
  
      etc, etc...
  </code></pre>
  
  <p>and need the map markers to display those numbers instead of simply MMSI.</p>
  
  <p>But I don't know how to achieve this as the program won't run every time I try it and google's api will only work with quotes, not variables.</p>
  
  <p>I'm pretty sure there is a simple answer to this question and I am sorry for having to ask such a stupid question but I can't seem to find an answer anywhere or figure it out on my own.</p>
  
  <p>Thanks in advance for any help.</p>
  
  <p>Also I'm sorry if I used any terms wrong I'm still learning this language and I don't always know if I'm saying things correctly.</p>