title: Creating a JavaScript Object from JSON File
body: <p>I have a json file like this below:</p>
  
  <p><strong>data.json:</strong></p>
  
  <pre><code>[
    {
      "id": 0,
      "key": "key0",
      "value": "val0"
    },
    {
      "id": 1,
      "key": "key1",
      "value": "val1"
    },
    {
      "id": 2,
      "key": "key2",
      "value": "val2"
    },
    {
      "id": 3,
      "key": "key3",
      "value": "val3"
    }
  ]
  </code></pre>
  
  <p>Now, i want to turn this json into javascript object like this format:</p>
  
  <p><strong>JavaScript Object:</strong></p>
  
  <pre><code>{
    key0: val0,
    key1: val1,
    key2: val2,
    key3: val3
  }
  </code></pre>
  
  <p>I have tried to find a solution with the functions (like each, map, ...), but i couldn't find a solution. I am not just looking for a solution, but the most efficent one.</p>
  
  <p>Do you have an idea?</p>