title: Magento validate category using JS
body: <p>I'm using an extension on google maps and I want to add different points depending the category.</p>
  
  <p>Here its the part of the code </p>
  
  <pre><code>var image = 'images/custom_icon.png';
  var image = 'images/custom_icon2.png';
  var marker = new google.maps.Marker(
     {
             position: new google.maps.LatLng(product.lat, product.lng),
  
             map: this.map,
  
             title: (product.items_count &lt; 2)? product.product_name : "" + product.items_count + "items",
  
             icon: image
  
     }
  </code></pre>
  
  <p>);</p>
  
  <p>what I want is to do something like that </p>
  
  <pre><code>  var marker = new google.maps.Marker(
     {
             position: new google.maps.LatLng(product.lat, product.lng),
  
             map: this.map,
  
             title: (product.items_count &lt; 2)? product.product_name : "" + product.items_count + "items",
  
  
             if (category == A) {
                 icon: image
             }
             else {
                 icon: image2
             }
     }
  </code></pre>
  
  <p>Could be possible to do something like that?</p>