title: How to use dot notation while accessing an element in a multi dimension array as a parameter passed in a function?
body: <p><em>I have been working on a multi-dimensional array.Upon working on it I have seen that if the element I want to get is a parameter in a function,then the element is inaccessible while using dot notation.</em><br/>Can some One explain why this code does so and is there any other way I can use dot notation?<br/>
  <strong>I know I can use brackets but I want to know why can't I use dot notation or there is a way?</strong></p>
  
  <p><strong>Code</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>
     _onSelect(option){
     this.componentDidMount(option.value);
      }
  
      componentDidMount(just){
          fetch('http://localhost:5000/api/data/numData')
          .then(function(response) {
              return response.json();
          })
          .then((data) =&gt;{
              var temp=(Object.keys(data.data[0]));
              var temp2=data.data;
              var temp3=[];
              if(just===undefined){
                  console.error(`Variable is Undefined ${just}`);
              }else{
                  for (let index = 0; index &lt; temp2.length; index++) {
                      var justParam=just;
                      var demo=temp2[index]
                      console.log(demo.justParam)    //here justParam or just is inaccessible 
  
                      //temp3.push(temp2[index][`${justParam}`]);
                  }
              }
              this.setState({
                  x : data.time,
                  y : temp3,
                  selectionParam : temp
              });
          });
      }
  </code></pre>
  
  <p><strong>Sample response from server</strong></p>
  
  <pre><code>{"data":[
  {"temperature":15,"humidity":16,"pressure":"1","rain":97,"wind":97},
  {"temperature":70,"humidity":71,"pressure":"1","rain":86,"wind":86},
  {"temperature":16,"humidity":17,"pressure":"1","rain":57,"wind":57},
  {"temperature":37,"humidity":38,"pressure":"1","rain":38,"wind":38},
  {"temperature":18,"humidity":19,"pressure":"1","rain":57,"wind":57},
  {"temperature":31,"humidity":32,"pressure":"1","rain":51,"wind":51},
  {"temperature":95,"humidity":96,"pressure":"1","rain":58,"wind":58},
  {"temperature":49,"humidity":50,"pressure":"1","rain":9,"wind":9}
  ]}
  
  </code></pre>
  
  <p>Error</p>
  
  <pre><code> Line 33:  'justParam' is assigned a value but never used  no-unused-vars
  </code></pre>
  
  <p>Here justParam is inaccessible in <code>temp3.push(temp2[index].justParam);</code></p>