title: Does anyone know how I dynamically change this variable?
body: <p>I would like to be able to change which data gets targetted in &quot;immutable_data&quot; depending on what arg I put with the &quot;renderTags&quot; function, what would be the best way to do this? I've tried lots of different things but it's not getting the right object, thanks</p>
  <pre><code>async function renderTags(args) {
      let atts = await fetchAtt();
      var flags = [], output = [], l = atts.data.length, i;
          for( i=0; i&lt;l; i++) {
      if( flags[atts.data[i].immutable_data.ARGS]) continue;
      flags[atts.data[i].immutable_data.ARGS] = true;
      output.push(atts.data[i].immutable_data.ARGS); 
  }console.log(output);
  
  }
  
  renderTags(variant);
  </code></pre>
  <p>I am fetching an API, loop all the &quot;atts.data&quot; and uniquely storing my chosen bit of data from inside the data's immutable.data. For example my</p>
  <pre><code>renderTags(variant)
  </code></pre>
  <p>will look for</p>
  <pre><code>atts.data[i].immutable_data.variant
  </code></pre>
  <p>and</p>
  <pre><code>renderTags(name); 
  </code></pre>
  <p>should look like</p>
  <pre><code>atts.data[i].immutable_data.name 
  </code></pre>
  <p>,etc.</p>