Does javascript guarantees that the sequence of keys of an object gets preserved even if the new value is assigned to a key?
For example, if i have the following object
var Object = {
keyX: value1,
keyB: value2,
keyZ: value3
}
If i iterate through keys using for .. in
, I get the proper sequence i.e. keyX, keyB, keyZ
. and if I change the value of keyB
, I am still getting the same sequence in iteration.
My question is, will the sequence remains the same always, or it might change in any case?