title: Converting JSON string to object with selective evaluation
body: <p>I have a string:</p>
  
  <pre><code>"{0:16970861903381446063,length:1}"
  </code></pre>
  
  <p>I tried converting it to an object using the <code>eval</code> method, but it also evaluates the string and hence rounds the numerical value, returning:</p>
  
  <pre><code>{0:16970861903381447000,length:1}
  </code></pre>
  
  <p>I tried passing the number as a string before calling <code>eval</code> on it, 
  using <code>16970861903381446063 + ''</code> as the value when creating the JSON string; checking it with <code>typeof</code> shows it as being of type <code>string</code>, but it still rounds the number 16970861903381446063 to 16970861903381447000.</p>
  
  <p>Is there a way I can bypass this, or a better way to do this?</p>
  
  <p>Following is the code that generates the json text from an array containing the numbers</p>
  
  <pre><code>function simplify(arr){
        request = "{";
        if (arr.length ==1){
           request += 0 +  ":" + (arr[0] + '')  + "," ; 
        }
        else{
           for (var i=0;i&lt;=arr.length-1  ;i++){
  
          request +=  i +  ":" +  (arr[i] + '')  + ",";
       }
      }
     request += "length" + ":" + arr.length +"}";
     return request;
   }
  </code></pre>