Do Object.keys() and Object.values() methods return arrays that preserve the same order : <p>Do <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys" rel="noreferrer">Object.keys()</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values" rel="noreferrer">Object.values()</a> methods return arrays that preserve the same order?</p>

<p>I mean, suppose that we have the following object:</p>

<pre><code>var obj = {};
obj.prop1 = "Foo";
obj.prop2 = "Bar";
</code></pre>

<p>If I call <code>obj.keys()</code> and <code>obj.values()</code> will they return properties with the same order?</p>

<pre><code>prop1
prop2

Foo
Bar
</code></pre>

<p>or</p>

<pre><code>prop2
prop1

Bar
Foo
</code></pre>

<p>Right?</p>

<p>So the following option is not possible, right?</p>

<pre><code>prop1
prop2

Bar
Foo
</code></pre>
