getting the error that location_marker.addListener is not a function? :        


       function initAutocomplete() {
         map = new google.maps.Map(document.getElementById('map'), {
          center: {lat: 31.7917 , lng: 7.0926},
          zoom: 3,
          mapTypeId: 'roadmap'
        });


                  
      

>initialize map

                var location_marker;
                  for (var i = 0; i < locations.length; i++) {

                        location_marker = markers.push(new google.maps.Marker({
                          map: map,
                          title: locations[i].title,
                          position: locations[i].location

                        }));

                         
                  }

> running through a list of locations and placing a marker for each

              
                          var infowindow = new google.maps.InfoWindow({
                            content: location_marker.title
                          });
                          location_marker.addListener('click', function() {
                              infowindow.open(map, location_marker);
                            });

            
          };

> create an info window that displays every marker's title

getting the error that location_marker.addListener is not a function, even though the syntax looks correct