title: change json value's datatype in javascript
body: <p>I have a JSON object with following values:</p>
  <pre><code>var json = [{
    &quot;Time&quot;: &quot;2017-08-17 16:35:28.000&quot;,
    &quot;Value&quot;: &quot;3.85&quot;
  }, {
    &quot;Time&quot;: &quot;2017-08-17 17:36:28.000&quot;,
    &quot;Value&quot;: &quot;3.85&quot;
  }, {
    &quot;Time&quot;: &quot;2017-08-17 18:35:28.000&quot;,
    &quot;Value&quot;: &quot;3.86&quot;
  }, {
    &quot;Time&quot;: &quot;2017-08-17 19:35:28.000&quot;,
    &quot;Value&quot;: &quot;3.86&quot;
  }, {
    &quot;Time&quot;: &quot;2017-08-18 07:35:28.000&quot;,
    &quot;Value&quot;: &quot;3.87&quot;
  }, {
    &quot;Time&quot;: &quot;2017-08-18 18:35:28.000&quot;,
    &quot;Value&quot;: &quot;3.86&quot;
  }];
  </code></pre>
  <p>The Time is in string format and I would like to change it to datetime.(Im storing them in x and y which I'm using for Highcharts)
  I have used the following function:</p>
  <pre><code>json.forEach(function(element, index) {
    element.x = new Date(element['Time']).getTime();
    element.y = +element['Value'];
  
    delete element['Time'];
    delete element['Value'];
  });
  </code></pre>
  <p>I am getting an error : json.forEach is not a function</p>
  <p>Output Images:
  In the Developer tools sources tab:
  <a href="https://i.stack.imgur.com/ckfaU.png" rel="nofollow noreferrer">Image</a></p>
  <p>In the alert:
  <a href="https://i.stack.imgur.com/XyJ8I.png" rel="nofollow noreferrer">Alert</a></p>
  <p>As you can see, in the developer tools, it has quotes, whereas in alert it doesn't. Don't know what the issue is</p>
  <p>PS: Sorry i don't have enough reputation to embed the images directly</p>