title: Jquery - How to convert Array of Object to Json string
body: <p>There is <code>SymbologyObject</code> and <code>ValuesArray</code>:</p>
  
  <pre><code>var SymbologyObject = {};
  var ValuesArray = [];
  </code></pre>
  
  <p>Put something into them like below:</p>
  
  <pre><code>var ValueOfField = "tree";
  ValuesArray[ValueOfField] = [];
  
  var localStyle = {};
  localStyle.fill = "#ffff";
  localStyle.stroke = "#cccc";
  localStyle.width = 3;
  localStyle.value = ValueOfField;
  
  ValuesArray[ValueOfField] = localStyle;
  
  SymbologyObject.type = "Unique";
  SymbologyObject.label = "test";
  
  SymbologyObject.attr = "attribute";
  
  SymbologyObject.values = ValuesArray;
  </code></pre>
  
  <p>When I use <code>console.log(SymbologyObject);</code> output is:</p>
  
  <pre><code>attr:"attribute"
  label:"test"
  type:"Unique"
  values:
  tree:{fill: "#ffff", stroke: "#cccc", width: "3", value: "tree"}
  </code></pre>
  
  <p>I convert it to json:</p>
  
  <pre><code>JSON.stringify(SymbologyObject);
  </code></pre>
  
  <p>output of above code:</p>
  
  <pre><code>{"type":"Unique","label":"test","attr":"attribute","values":[]}
  </code></pre>
  
  <p>but i want below output:</p>
  
  <pre><code>{"type":"Unique","label":"test","attr":"attribute","values":[tree:{"fill": "#ffff", "stroke": "#cccc", "width": "3", "value": "tree"}]}
  </code></pre>
  
  <p>What is wrong?</p>