Javascript - maintain key order when going from object -> array -
i know key order isn't guaranteed in js objects, however, data structure comes backend have no control over. there can preserve key order when going from:
var obj = { foo: 'bar', bar: 'foo' };
to:
object.keys(obj); // hoping ['foo', 'bar']
it's of utmost importance keep key order unfortunately...
no. wrote:
i know key order isn't guaranteed in js objects
if want order need use array. if have object, there no defined order properties.
Comments
Post a Comment