title: Serializing to JSON in jQuery
body: <p>I need to <a href="https://en.wikipedia.org/wiki/Serialization" rel="noreferrer">serialize</a> an object to <a href="https://www.json.org/" rel="noreferrer">JSON</a>. I'm using <a href="https://api.jquery.com/" rel="noreferrer">jQuery</a>. Is there a "standard" way to do this?</p>
  
  <p>My specific situation: I have an array defined as shown below:</p>
  
  <pre><code>var countries = new Array();
  countries[0] = 'ga';
  countries[1] = 'cd';
  ...
  </code></pre>
  
  <p>and I need to turn this into a string to pass to <a href="https://www.w3schools.com/jquery/ajax_ajax.asp" rel="noreferrer"><code>$.ajax()</code></a> like this:</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "Concessions.aspx/GetConcessions",
      data: "{'countries':['ga','cd']}",
  ...
  </code></pre>