title: Safari JS Syntax error: Unexpected token '='
body: <p>I build store locator with google maps. It works in every browser but safari and I have no clue why. 
  Safari throws an error:
  <em>SyntaxError: Unexpected token '='. Expected a ')' or a ',' after a parameter declaration.</em></p>
  
  <p>Here's the code (I shortend it a bit):</p>
  
  <pre><code>    var marker = [];
  var LatLng;
  var infoWindow = new google.maps.InfoWindow();
  var markerInfo = [];
  var bounds = new google.maps.LatLngBounds();
  var queryLatlng = new google.maps.LatLng(50.9683679, 10.7635554);
  var zoom = 6;
  var markers = [];
  var mapOptions = {
      center: queryLatlng,
      zoom: zoom,
      scroll: false,
      scrollwheel: false,
      streetViewControl: false,
      mapTypeControl: true,
      mapTypeControlOptions: {
          position: google.maps.ControlPosition.TOP_LEFT
      },
      zoomControl: true,
      zoomControlOptions: {
          position: google.maps.ControlPosition.TOP_LEFT
      },
      mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  var map = new google.maps.Map(document.getElementById("map"),mapOptions);
  var styles = [{
      url: '../icon_marker_cluster30.png',
      height: 30,
      width: 30,
      anchor: [5, 0],
      textColor: '#ffffff',
      textSize: 13
    }, {
      url: '../icon_marker_cluster40.png',
      height: 40,
      width: 40,
      anchor: [9, 0],
      textColor: '#ffffff',
      textSize: 14
    }, {
      url: '../icon_marker_cluster50.png',
      width: 50,
      height: 50,
      anchor: [13, 0],
      textColor: '#ffffff',
      textSize: 16
    }];
  
  function init(){            
      latlng = new google.maps.LatLng(50.343597, 19.007915);
      marker['1'] = new google.maps.Marker({
              position: latlng,
              map: map
      });
  
      markers.push(marker['1']);
  
      marker['1'].addListener('click', function() {
          map.setZoom(15);
          map.setCenter(marker['1'].getPosition());
      });
  
      bounds.extend(latlng);
  
      markerInfo['1'] = createMarkerInfo("store", "address", "zipcode", "city");
      google.maps.event.addListener(marker['1'], 'click', function() {
          infoWindow.setContent(markerInfo['1']);
          infoWindow.open(map, marker['1']);
      });
  
  
      var markerCluster = new MarkerClusterer(map, markers, {styles: styles});
  
      google.maps.event.addListener(map, 'idle', function() {
          showVisibleMarkers();
      });
  
      map.fitBounds(bounds);
  }
  
  function createMarkerInfo(name, address, zip, city, phone = null, mail = null){
      var output = '';
  
      output += '&lt;span class="label"&gt;' + name + '&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;';
      output += address + '&lt;br /&gt;';
      output += zip + ' ' +  city + '&lt;br /&gt;';
  
      if(phone)
          output += '&lt;br /&gt;&lt;i class="fa fa-phone"&gt;&lt;/i&gt; ' + phone;
      if(mail)
          output += '&lt;br /&gt;&lt;i class="fa fa-envelope"&gt;&lt;/i&gt; &lt;a href="mailto:' + mail + '"&gt;' + mail + '&lt;/a&gt;';
  
      return output;
  }
  
  function showMarker(id){
      google.maps.event.trigger(marker[id], 'click');
      $('html, body').animate({
          scrollTop: $("#map").offset().top
      }, 500);
  }
  
  function showVisibleMarkers() {
      var bounds = map.getBounds();
  
      for (var i = 0; i &lt; markers.length; i++) {
          var marker = markers[i],
              infoPanel = $('table tr[data-marker="'+i+'"]'); // array indexes start at zero, but not our class names :)
  
          if(bounds.contains(marker.getPosition())===true) {
              infoPanel.removeClass('hidden');
          }
          else {
              infoPanel.addClass('hidden');
          }
      }
  
      $("table tr").removeClass("odd");
      $("table tr:visible:odd").addClass("odd");
  }
  
  google.maps.event.addDomListener(window, "load", init);
  </code></pre>
  
  <p>I did some googleling and found some hints with 'anonymous function' but I don't know how and where the problem happens.</p>
  
  <p><strong>EDIT:</strong>
  I could track the problem down to the function 'createMarkerInfo'. But still no clue :(</p>