title: Get square brackets instead of curly in json in javascript
body: <p>If I want to update object in elasticsearch script, thus I need to send some weird modification of JSON (<a href="https://discuss.elastic.co/t/updating-an-object-field/110735/2" rel="nofollow noreferrer">https://discuss.elastic.co/t/updating-an-object-field/110735/2</a>). I don't really know what language is that or why would they do that.</p>
  
  <p>For example, if input is</p>
  
  <pre><code>{"id": 2, "name": "John"}
  </code></pre>
  
  <p>I need the way in javascript to make it</p>
  
  <pre><code>["id": 2, "name": "John"]
  </code></pre>
  
  <p>First sloultion would be</p>
  
  <pre><code>standardJson.replace('{', '[').replace('}', ']')
  </code></pre>
  
  <p>However, I am worried about curly brackets inside values, so above solution would override </p>
  
  <pre><code>"name": "{John"
  </code></pre>
  
  <p>to</p>
  
  <pre><code>"name": "[Jonh"
  </code></pre>
  
  <p>And I don't want that. In fact, I need to this inside general purporse library, so I can't just hope this case will not happen.</p>