title: I need to access data from a different javascript file, and change it into a string
body: <p>I need to access data in this format to use it with Chart.js:</p>
  
  <pre><code>var dataArrays = {
    id: 1,
    time : [1543855884861,1543855889279],
    parsetTimestamp: ["3 Dec 2018 17:51:24","3 Dec 2018 17:51:29"],
    temperature: [23.4,24.4],
    humidity: [38,40],
    light: [1000,1100],
    soil: [750,800],
    fanIn: [1,0],
    fanOut: [0,1],
    ledIntensity: [1024,1024]
   }
  </code></pre>
  
  <p>I need to get the data from a different js file, formatted like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>var data = [{
      name: 'tube',
      time: 1546614557692,
      temperature: 23,
      humidity: 49,
      light: 1718,
      soil: 1024,
      fanIn: 0,
      fanOut: 0,
      ledIntensity: 1024
    },
    {
      name: 'tube',
      time: 1546614557697,
      temperature: 23,
      humidity: 49,
      light: 1721,
      soil: 1024,
      fanIn: 0,
      fanOut: 0,
      ledIntensity: 1024
    }
  ]
  </code></pre>
  
  <p>I think I can add data from different variables like this:</p>
  
  <pre><code>var dataArrays.time = [data1.time, data2.time];
  </code></pre>
  
  <p>but I don't have two variables, I only have one with all the data, and it's located in a different file. </p>
  
  <p>Is there a way to do this?</p>