title: eval typeof is undefined in javascript
body: <p>I am trying to create JSON object entered into textbox using below code.</p>
  
  <p><strong>colnames</strong> is array of columns from table  colnames = [DEPTNO,DNAME],</p>
  
  <p>I  am trying to create JSON object dynamically. e.g.</p>
  
  <p>tableInsert.DEPTNO = 100;
  tableInsert.DNAME= sales;</p>
  
  <p>but when i run it, it always complain <strong>console.log (eval ("tableInsert."  + col));</strong> is undefined. Any help..</p>
  
  <pre><code>  document.getElementById("insercols").onclick = function(){
      var tableInsert ='';
      var colvalue='';
      console.log("cols are " + colnames);
      for (col of colnames){
          colvalue = document.getElementById(col).value;
          eval ("tableInsert." + col + " = " + "typeof "+  colvalue);
  
          console.log("tableInsert." + col + " = " + "typeof "+  colvalue);
          console.log (eval ("tableInsert."  + col));
  
      }
  }
  </code></pre>