title: Creating leaflet markers and storing them in variables by looping through a list of objects
body: <p>I am creating a map in leaflet which has markers on the map of various businesses.
  I created the markers by looping through a list of objects without a problem.</p>
  <p>However, I want to be able to pan to each of these markers using a sidebar on my website (outside of the leaflet map). I can do this by creating each individual marker as a variable, but my list is huge and too big to do this manually.</p>
  <p>My list of businesses are objects like below:</p>
  <pre><code>   businesses = [{
         'name': 'Business name 1',
         'location': 'address',
         'id': 'businessid',
         'website': 'http://website',
         'coords':[0,0]
     },]
  </code></pre>
  <p>I created the markers by doing this:</p>
  <pre><code>businesses.forEach(element =&gt; 
      L.marker([element.coords[0],element.coords[1]]).addTo(mymap)
     .bindPopup(&quot;&lt;strong&gt;&quot;+element.name+&quot;&lt;/strong&gt;&quot;));
  </code></pre>
  <p>But I think I can only link to the above markers in my html sidebar if they are declared as a variable. How can I recreate the code above ^ but set each loop instance as a variable? Is this possible?</p>