title: jQuery.parseJSON disordered array
body: <p><em>Initial PHP ARRAY Storing attributes as values and respective id's on key</em></p>
  
  <pre><code>Array
  (
  [979] =&gt; Pict Model
  [962] =&gt; Brand
  [494] =&gt; Dimensions
  [980] =&gt; Capacity
  [981] =&gt; Power
  [982] =&gt; List Price
  [983] =&gt; Warrenty
  [975] =&gt; USB Connection
  [976] =&gt; Self Cleaning
  [977] =&gt; Double Glass Door
  [978] =&gt; Steam Function
  [974] =&gt; Electricity Type
  )
  </code></pre>
  
  <p>In my Code below, <strong>comparable_attr</strong> holds the json encoded array.
  After that, as i <strong>console.log(comparable_attr)</strong> This gives me a json of order as of php array.</p>
  
  <p>Then, after i parseJSON and then console.log it gave me data in different order.</p>
  
  <pre><code>var comparable_attr = '&lt;?php echo json_encode($_comparable_attributes); ?&gt;';
     if(comparable_attr.length != 0){       //check for empty json
        console.log(comparable_attr);
            var obj = jQuery.parseJSON(comparable_attr);
                  console.log(obj);
  }
  </code></pre>
  
  <p><strong>Problem :</strong> i want to achieve it in same order after i parseJSON.</p>
  
  <p><strong>The result obtained :</strong></p>
  
  <p><em>First Console.log(comparable_attr) gives:</em></p>
  
  <pre><code>{"979":"Pict Model","962":"Brand","494":"Dimensions","980":"Capacity","981":"Power","982":"List Price","983":"Warrenty","975":"USB Connection","976":"Self Cleaning","977":"Double Glass Door","978":"Steam Function","974":"Electricity Type"}
  </code></pre>
  
  <p><em>Second Console.log(obj) gives :</em></p>
  
  <pre><code> Object { 494="Dimensions", 962="Brand", 974="Electricity Type", more...}
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/oVdLR.png" alt="enter image description here"></p>
  
  <p><strong>Edited</strong> : </p>
  
  <p>What i have found is, it shorted according to my attribute id, which i need in the same order as it is in array.</p>