title: Reactjs : Adding element to array object in Json
body: <p>I have just started with reactjs and working on form component(formsy).I am trying to add and element to the existing array element but I am not able to do so. below is what I have tried and what I have got so far.</p>
  
  <p>JSON Object - </p>
  
  <pre><code>{
     "details": {
         "someInnerObj": "v3",
         "innerObj": {
             "key1": "",
             "key2": ""
         },
         "ArrayObject": [{
                 "type": "sometype",
                 "somedesign": {
                     "A": "",
                     "B": "",
                     "C": "",
                     "D": ""
                 },
                 "somedev": {
                     "a": "",
                     "b": "",
                     "c": "",
                     "d": ""
                 }
             }
         ],
         "code": "code",
         "isThis": "true"
     }
  }
  </code></pre>
  
  <p>what i am trying to achieve here is adding and element to ArrayObject like below</p>
  
  <pre><code>"ArrayObject": [{
                 "type": "sometype",
                 "somedesign": {
                     "A": "",
                     "B": "",
                     "C": "",
                     "D": ""
                 },
                 "somedev": {
                     "a": "",
                     "b": "",
                     "c": "",
                     "d": ""
                 }
             },
             {
                 "type": "sometype1",
                 "somedesing1": {
                     "A1": "",
                     "B1": "",
                     "C1": "",
                     "D1": ""
                 },
                 "somedev1": {
                     "a1": "",
                     "b1": "",
                     "c1": "",
                     "d1": ""
                 }
             }
         ]
  </code></pre>
  
  <p>I am putting new element using the field value of json object as 
  "details.ArrayObject[1]". but it instead of adding the new element is creating new key as given below and removing the existing - </p>
  
  <pre><code>"ArrayObject": {
              "[1]": {
                     "type": "sometype1",
                     "somedesing1": {
                         "A1": "",
                         "B1": "",
                         "C1": "",
                         "D1": ""
                     },
                     "somedev1": {
                         "a1": "",
                         "b1": "",
                         "c1": "",
                         "d1": ""
                     }
                 }
          }
  </code></pre>
  
  <p>Could anyone please help out here ?</p>
  
  <p>thanks.</p>