title: How to get unique feature properties from geojson source in Mapbox GL JS?
body: <p>I've defined a mapbox <a href="https://docs.mapbox.com/mapbox-gl-js/style-spec/#sources-geojson" rel="nofollow noreferrer">geojson</a> source:</p>
  
  <pre><code>map.addSource("places", {
      type: "geojson",
      data: "http://example.com/myfile.geojson",
  });
  </code></pre>
  
  <p>My geojson source file has this structure:</p>
  
  <pre><code>{
  "type": "FeatureCollection",
  "features": [{
      "type": "Feature",
      "properties": {
          "icon": "theatre"
      },
      "geometry": {
          "type": "Point",
          "coordinates": [-77.038659, 38.931567]
      }},
  
      {
      "type": "Feature",
      "properties": {
          "icon": "music"
      },
      "geometry": {
          "type": "Point",
          "coordinates": [-77.020945, 38.878241]
      }},
      ...]
  }
  </code></pre>
  
  <p>I would like to get the <em>unique</em> names of the 'icon' properties (here: theatre and music). How can I loop over source to get these unique values? The objective here is to add a layer from these unique names for filtering purposes.</p>