title: How to prevent automatic sort of Object numeric property?
body: <p>Why I met this problem:
  I tried to solve an algorithm problem and I need to return the number which appeared most of the times in an array. Like [5,4,3,2,1,1] should return 1.
  And also when two number appear same time as the maximum appearance return the one came first. Like [5,5,2,2,1] return <strong>5</strong> because <strong>5</strong> appear first. I use an object to store the appearance of each number. The key is the number itself.</p>
  
  <p>So When the input is [5,5,2,2,1] my object should be
   <code>Object {5: 2, 2: 2, 1: 1}</code> but actually I got <code>Object {1: 1, 2: 2, 5: 2}</code>
  So When I use for..in to iterate the object I got <strong>2</strong> returned instead of <strong>5</strong> . So that's why I asked this question. </p>
  
  <p>This problem occurs in Chrome console and I'm not sure if this is a common issue:
  When I run the following code</p>
  
  <pre><code>var a = {};
  a[0]=1;
  a[1]=2;
  a[2]=3;
  </code></pre>
  
  <p><strong>a</strong> is: <code>Object {0: 1, 1: 2, 2: 3}</code></p>
  
  <p>But when I reverse the order of assignment like:</p>
  
  <pre><code> var a = {};
   a[2]=3;
   a[1]=2;
   a[0]=1;
  </code></pre>
  
  <p><strong>a</strong> is also:<code>Object {0: 1, 1: 2, 2: 3}</code>
  The numeric property automatic sorted in ascending order.
  I tried prefix or postfix the numeric property like </p>
  
  <pre><code>var a = {};
  a['p'+0]=1;
  a['p'+1]=2;
  a['p'+2]=3;
  console.log(a);//Object {p0: 1, p1: 2, p2: 3}
  </code></pre>
  
  <p>And this keep the property order. Is this the best way to solve the problem?  And is there anyway to prevent this auto sort behavior? Is this only happen in Chrome V8 JavaScript engine? Thank you in advance!</p>