title: Parse array-like string into an array of json objects in JavaScript
body: <p>I have a String in the following format:</p>
  
  <pre><code>[{"type":"relativeHumidity","unit":"%","resolution":300,"accuracy":0.0,"period":"INSTANT","correction":false,"completenessRatios":[{"completenessRatio":0.0,"period":"SIX_MONTHS"},{"completenessRatio":0.0,"period":"THIRTY_DAYS"},{"completenessRatio":0.5789037386601943,"period":"FULL_HISTORY"}]},{"type":"temperature","unit":"C","resolution":300,"accuracy":0.0,"period":"INSTANT","correction":false,"completenessRatios":[{"completenessRatio":0.0,"period":"SIX_MONTHS"},{"completenessRatio":0.0,"period":"THIRTY_DAYS"},{"completenessRatio":0.5789037386601943,"period":"FULL_HISTORY"}]}]
  </code></pre>
  
  <p>It resembles an array of two json objects. I need to retrieve these JSON objects.</p>
  
  <p>I have tried to parse it using JSON.parse(str) but complaints about the "," that separates JSONs in this array-like structure.</p>
  
  <p>I have tried doing str.split(",") but it splits by each comma, e.g.</p>
  
  <pre><code>  [0] [{"type":"relativeHumidity"
  
    [1] "unit":"%"
  </code></pre>
  
  <p>I have tried removing first and last brackets and reading it as an array:</p>
  
  <pre><code>var arr = [str.substr(1, value.length - 2)];
  
  [ '{"type":"relativeHumidity","unit":"%","resolution":300,"accuracy":0.0,"period":"INSTANT","correction":false,"completenessRatios":[{"completenessRatio":0.0,"period":"SIX_MONTHS"},{"completenessRatio":0.0,"period":"THIRTY_DAYS"},{"completenessRatio":0.5789037386601943,"period":"FULL_HISTORY"}]},{"type":"temperature","unit":"C","resolution":300,"accuracy":0.0,"period":"INSTANT","correction":false,"completenessRatios":[{"completenessRatio":0.0,"period":"SIX_MONTHS"},{"completenessRatio":0.0,"period":"THIRTY_DAYS"},{"completenessRatio":0.5789037386601943,"period":"FULL_HISTORY"}]}' ]
  </code></pre>
  
  <p>but it creates an array of a single string.</p>
  
  <p>Any help on how to read that string into an array of JSON objects will be greatly appreciated.</p>