title: Convert nested object to JSON Jquery
body: <p>I have dictionary which is nested as shown below: </p>
  
  <p><a href="https://i.stack.imgur.com/BGH0M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BGH0M.png" alt="enter image description here"></a></p>
  
  <p>I want to convert this object to JSON which will be used to send to controller. I have tried to convert the same to array but nothing worked for me.</p>
  
  <pre><code>array = Object.keys(dicCoachList).map(function (k) {
      return dicCoachList[k];
  });
  </code></pre>
  
  <p>Which I send to controller using ajax.</p>
  
  <pre><code>$.ajax({
          url: '/Dispatch/SavePatientCoaching/',
          data: { careProfessional : array },
          type: "POST",
          success: function (data) {
  
          },
  </code></pre>
  
  <p>In controller like this. </p>
  
  <pre><code>[HttpPost]
  public ActionResult SavePatientCoaching(string[] careProfessional)
  {
  }
  </code></pre>
  
  <p>If I convert my object to json it just return <code>"{"1":[],"2":[]}"</code> So I used array. Please help me send this data to controller.</p>