title: React accessing to array's values using dynamic naming for the variables
body: <p>Here is a simple printing out of the values of an array:</p>
  <pre><code>export default function App() {
    var data = [{name:'Jhon', age:28, city:'HO'},
              {name:'Onhj', age:82, city:'HN'},
              {name:'Nohj', age:41, city:'IT'}
             ];
  
      data.map(({name, age}, i) =&gt; {
         console.log(name + ' ' + age);
      })
   }
  </code></pre>
  <p>Now, I receive the names of the values in another array, how can I print out the values of the array using a variable:</p>
  <pre><code>    export default function App() {
        var data = [{name:'Jhon', age:28, city:'HO'},
                  {name:'Onhj', age:82, city:'HN'},
                  {name:'Nohj', age:41, city:'IT'}
                 ];
       //Here are the keys of the array
       var colNames =  ['name','age'];
      
          data.map(({colNames}, i) =&gt; {
          //So I can do something like
             console.log(colNames[0] + ' ' + colNames[1]);
          })
  }
  </code></pre>
  <p>Thanks!</p>