Do Object.keys() and Object.values() methods return arrays that preserve the same order?
I mean, suppose that we have the following object:
var obj = {};
obj.prop1 = "Foo";
obj.prop2 = "Bar";
If I call obj.keys()
and obj.values()
will they return properties with the same order?
prop1
prop2
Foo
Bar
or
prop2
prop1
Bar
Foo
Right?
So the following option is not possible, right?
prop1
prop2
Bar
Foo